the #! notation

Brandon S. Allbery KB8JRR allbery at NCoast.ORG
Wed Jan 23 15:40:19 AEST 1991


As quoted from <587 at fciva.FRANKCAP.COM> by dag at fciva.FRANKCAP.COM (Daniel A. Graifer):
+---------------
| Perhaps I've missed something here, but none of this #! stuff works on my
| machine (running Sys V/386 3.1).  Is this something that only works in 
| BSD-derived unixes?  What about V3.2 or V4?
+---------------

It's a BSD-ism (and requires some kernel hacks to implement).  It also
includes the seeds of a security hole --- if you've ever read any messages on
the net about "disabling setuid shell scripts", the #! mechanism is both what
makes setuid shell scripts possible and what makes them insecure.

Note that some shells can emulate this mechanism when the kernel doesn't
support it --- I think bash does, for instance, and I have posted my "bexec"
mechanism for making any System V csh do so many times.  (I will *not* repost
it here yet again; if anyone wants it, send me mail.  But considering the
number of times I've posted it in the past, it ought to be archived all over
the net by now.)

++Brandon
-- 
Me: Brandon S. Allbery			    VHF/UHF: KB8JRR on 220, 2m, 440
Internet: allbery at NCoast.ORG		    Packet: KB8JRR @ WA8BXN
America OnLine: KB8JRR			    AMPR: KB8JRR.AmPR.ORG [44.70.4.88]
uunet!usenet.ins.cwru.edu!ncoast!allbery    Delphi: ALLBERY



More information about the Comp.unix.shell mailing list