perror(3) considered harmful

edhall%rand-unix at sri-unix.UUCP edhall%rand-unix at sri-unix.UUCP
Fri Mar 9 08:33:00 AEST 1984


From:  Ed_Hall <edhall at rand-unix>

>                                                            ...The fact that
> the kernel handles "#!" in a shell script is a major blunder.  The kernel
> has no business opening shell scripts and poking around in them...
>                                         ...Why should the kernel know
> ANYthing about the semantics of command files?  Leave it to a program (say,
> csh or sh, radical suggestion!) to parse command files.

I suspect that you've never made a SUID shell script.  It is impossible
without putting #! implementation in the kernel (unless you want to
eliminate system security).  The few hundred bytes of code needed to
implement #! in the kernel is code well spent, in my opinion.

Incidently, let me remind anyone who wants to make a SUID shell script
to *always* explicitly set the search path ($PATH or $path) at the
beginning of the script, and to *never* include the current directory
(or any relative pathname) in that path.  To do otherwise is to leave
a security hole a mile wide.

		-Ed Hall
ARPA:           edhall at rand-unix
UUCP:           decvax!randvax!edhall



More information about the Comp.unix mailing list