Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: Re: #! troubles Message-ID: <2047@uvaarpa.virginia.edu> Date: 12 Jan 90 22:44:36 GMT Sender: mmdf@uvaarpa.virginia.edu Reply-To: worley@compass.com Lines: 35 X-Name: Dave Burton 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) - Well, exec() seems to be able to pass it to the new program, and exec() seems to be a kernel call... What happens when the PATH is ".:/bin:/usr/bin", and the script is suid root? How about: Yes, of course, if you have a setuid script, you don't want to have the kernel search the path for the interpreter. But setuid things are *always* a special case. If you want to write setuid scripts, you have to have a trusted interpreter, and root has to install it in a safe place, and the script has to hard-code its location. But in the ordinary case, it would make life much easier if interpreter paths didn't have to be hard-coded. Dale Worley Compass, Inc. worley@compass.com -- ...and finally, a thought that I ripped off from someone a few months back: Let us live!!! Let us love!!! Let us share the deepest secrets of our souls!!! You first.