summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjwd <jwd@FreeBSD.org>2001-11-28 03:26:58 +0000
committerjwd <jwd@FreeBSD.org>2001-11-28 03:26:58 +0000
commit2a6f1a68f9a37cfcb5a656dc1e4220b5cb3686bd (patch)
tree2d7cb338d9de6526161b14c0d81b2bd15578a3c6 /sys
parentca5b2bc739a0ba228a9c6374dcd9483191fea795 (diff)
downloadFreeBSD-src-2a6f1a68f9a37cfcb5a656dc1e4220b5cb3686bd.zip
FreeBSD-src-2a6f1a68f9a37cfcb5a656dc1e4220b5cb3686bd.tar.gz
Return a more meaningful errno when the length of the interpreter
exceeds MAXSHELLCMDLEN to avoid secondary /bin/sh execution. Update execve man page to reflect change. Increase MAXSHELLCMDLEN to a slightly more meaningful value. PR: kern/32106 Submitted by: b@etek.chalmers.se Reviewed by: bsd MFC after: 2 weeks
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/imgact_shell.c2
-rw-r--r--sys/sys/imgact.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/imgact_shell.c b/sys/kern/imgact_shell.c
index a15b56c..8480fcc 100644
--- a/sys/kern/imgact_shell.c
+++ b/sys/kern/imgact_shell.c
@@ -74,7 +74,7 @@ exec_shell_imgact(imgp)
*/
for (ihp = &image_header[2]; *ihp != '\n' && *ihp != '#'; ++ihp) {
if (ihp >= &image_header[MAXSHELLCMDLEN])
- return(ENOEXEC);
+ return(ENAMETOOLONG);
}
line_endp = ihp;
diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h
index c4647c5..b6f67a4 100644
--- a/sys/sys/imgact.h
+++ b/sys/sys/imgact.h
@@ -36,7 +36,7 @@
#ifndef _SYS_IMGACT_H_
#define _SYS_IMGACT_H_
-#define MAXSHELLCMDLEN 64
+#define MAXSHELLCMDLEN 128
struct image_params {
struct proc *proc; /* our process struct */
OpenPOWER on IntegriCloud