Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Revert rev1.38. The header already begins with EXEC...



details:   https://anonhg.NetBSD.org/src/rev/b72adbb14ce2
branches:  trunk
changeset: 793620:b72adbb14ce2
user:      maxv <maxv%NetBSD.org@localhost>
date:      Fri Feb 21 08:11:59 2014 +0000

description:
Revert rev1.38. The header already begins with EXEC_SCRIPT_MAGIC="#!".
So it can't be ELFMAG="\177ELF" at the same time.

ok christos@

diffstat:

 sys/kern/exec_script.c |  11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diffs (32 lines):

diff -r c5781f8e958a -r b72adbb14ce2 sys/kern/exec_script.c
--- a/sys/kern/exec_script.c    Fri Feb 21 07:53:53 2014 +0000
+++ b/sys/kern/exec_script.c    Fri Feb 21 08:11:59 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec_script.c,v 1.68 2014/02/17 19:29:46 maxv Exp $    */
+/*     $NetBSD: exec_script.c,v 1.69 2014/02/21 08:11:59 maxv Exp $    */
 
 /*
  * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.68 2014/02/17 19:29:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.69 2014/02/21 08:11:59 maxv Exp $");
 
 #if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS)
 #define FDSCRIPTS              /* Need this for safe set-id scripts. */
@@ -155,13 +155,6 @@
        if (cp >= hdrstr + hdrlinelen)
                return ENOEXEC;
 
-       /*
-        * If the script has an ELF header, don't exec it.
-        */
-       if (epp->ep_hdrvalid >= sizeof(ELFMAG)-1 &&
-           memcmp(hdrstr, ELFMAG, sizeof(ELFMAG)-1) == 0)
-               return ENOEXEC;
-
        shellname = NULL;
        shellarg = NULL;
        shellarglen = 0;



Home | Main Index | Thread Index | Old Index