Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: $Revision: 1.6.2.16 $; site ISM780B.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!ISM780B!jim From: jim@ISM780B.UUCP Newsgroups: net.bugs.usg Subject: Re: Re: Sv.2 suid bits (why a RESTRICTED Message-ID: <29800007@ISM780B.UUCP> Date: Fri, 13-Dec-85 18:36:00 EST Article-I.D.: ISM780B.29800007 Posted: Fri Dec 13 18:36:00 1985 Date-Received: Mon, 16-Dec-85 05:36:28 EST References: <699@abic.UUCP> Lines: 27 Nf-ID: #R:abic:-69900:ISM780B:29800007:000:1116 Nf-From: ISM780B!jim Dec 13 18:36:00 1985 > Does anyone know why the stupid test for 'r' in the progname. > I thought I'd left that sort of junk behind with fortran! The real problem is an error in the design of #!, and that error appears to have been propagated everywhere (so at least it is consistent). When excuting a #! file, the kernel passes (the last component of) the file name as argv[0] to the program being run (e.g., sh). Thus, not only does any script containing an r invoke a restricted shell because the shell checks its argv[0] to decide whether it is to run restricted, but also when programs which use their argv[0] to determine how to identify themselves in error messages are run via #!, you get things like foo: syntax error in foo, line 47 instead of : syntax error in foo, line 47 And generally, any program which uses the name it is linked to to determine its behavior cannot be used effectively with #!. Whoever came up with this behavior no doubt thought at the time that it was clever. Such is the result of failure to think things through. -- Jim Balter, INTERACTIVE Systems Corporation (ima!jim)