On Tue, Jul 18, 2000 at 05:36:49PM -0400, Thomas Bushnell, BSG wrote:
> 
> Fixed, thanks.

Hi Thomas, 

while you are at bug fixing, can I draw your attention to Kalles fix to
the exec server? I applied the fix to the last Debian package of the Hurd,
and it works quite well.

http://bugs.debian.org/62557

If the #! line of a script contains an argument for the
interpreter, the argument gets its first character doubled.  This
prevents installation of packages which use #!/bin/sh -e in their
maintainer scripts.

kalle@PC486:/tmp$ ls -l abc
-rwxrwxr-x    1 kalle    root           16 Apr 17 17:16 abc
kalle@PC486:/tmp$ cat abc
#!/bin/echo def
kalle@PC486:/tmp$ ./abc
ddef ./abc

Here's the fix.  INTERP_LEN will still include the null because P
points to the character after the null.

--- hurd/exec/hashexec.c.orig   Mon Mar 20 08:57:44 2000
+++ hurd/exec/hashexec.c        Mon Apr 17 17:13:10 2000
@@ -178,7 +178,7 @@

       arg = p + strspn (p, " \t");
       arg_len = interp_len - 1 - (arg - interp_buf); /* without null here
*/
-      interp_len = p + 1 - interp; /* This one includes the null.  */
+      interp_len = p - interp; /* This one includes the null.  */

       if (arg_len == 0)
        arg = NULL;

After installing the patched version and rebooting:

kalle@PC486:/tmp$ ls -l abc
-rwxrwxr-x    1 kalle    root           16 Apr 17 17:24 abc
kalle@PC486:/tmp$ cat abc
#!/bin/echo def
kalle@PC486:/tmp$ ./abc
def ./abc
 

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server 
Marcus Brinkmann              GNU    http://www.gnu.org    for public PGP Key 
[EMAIL PROTECTED],     [EMAIL PROTECTED]    PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/       [EMAIL PROTECTED]

Reply via email to