Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rutgers!att!laidbak!daveb From: daveb@i88.isc.com (Dave Burton) Newsgroups: comp.lang.perl Subject: Re: #! troubles Message-ID: <1990Jan11.000117.7097@i88.isc.com> Date: 11 Jan 90 00:01:17 GMT References: <1970@uvaarpa.virginia.edu> Sender: stevea@i88.isc.com (Steve Alexander) Organization: Interactive Systems nee Lachman Associates Lines: 34 In article <1970@uvaarpa.virginia.edu> worley@compass.com writes: |The *real* solution for this problem is to have the kernel search your |path when it sees a #!. Otherwise, you have to be root to install a |new interpreter in the "standard" place, because the #!'s have the |interpreter's location hardcoded in. Assuming the kernel gets your $PATH (which it doesn't, but pretend) - What happens when the PATH is ".:/bin:/usr/bin", and the script is suid root? How about: $ cd $ cat > sh.c main() { setuid(0); execl("/bin/sh", "sh", (char *)0); } ^D $ cc -o sh sh.c $ cat script #!sh echo oops! $ ls -l script -rwsr-xr-x 1 root 16 Jul 26 16:19 script $ script # Searching $PATH is definitely NOT for the kernel. -- Dave Burton -- Dave Burton uunet!ism780c!laidbak!daveb