kernel recognizing #! scripts

Rich Altmaier richa at ios.UUCP
Fri Mar 9 07:33:19 AEST 1984


One advantage to having the kernel recognize #! scripts is
that set-uid/gid mode works.  Just as with a binary, the
kernel recognizes this mode and starts the shell or whatever with
appropriate effective uid/gid.  On 4.1bsd, scripts without
#! ignore set-uid mode.

I don't think a shell could give the same functionality, with the exec()
fail - recognize script approach.  The set-uid mechanism is
simple and useful, and I expect this is exactly why the kernel
was made to recognize #!.

	Rich Altmaier, Integrated Office Systems.
	decwrl!ios!richa



More information about the Comp.unix.wizards mailing list