patch-1.3.60 linux/fs/exec.c
Next file: linux/fs/fat/Makefile
Previous file: linux/fs/buffer.c
Back to the patch index
Back to the overall index
-  Lines: 14
 -  Date:
Wed Feb  7 08:55:39 1996
 -  Orig file: 
v1.3.59/linux/fs/exec.c
 -  Orig date: 
Sun Jan 14 16:30:12 1996
 
diff -u --recursive --new-file v1.3.59/linux/fs/exec.c linux/fs/exec.c
@@ -803,7 +803,13 @@
 			break;
 #ifdef CONFIG_KERNELD
 		}else{
+#define printable(c) (((c)=='\t') || ((c)=='\n') || (0x20<=(c) && (c)<=0x7e))
 			char modname[20];
+			if (printable(bprm.buf[0]) &&
+			    printable(bprm.buf[1]) &&
+			    printable(bprm.buf[2]) &&
+			    printable(bprm.buf[3]))
+				break; /* -ENOEXEC */
 			sprintf(modname, "binfmt-%hd", *(short*)(&bprm.buf));
 			request_module(modname);
 #endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this