Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!husc6!cmcl2!rutgers!clyde!cbosgd!cwruecmp!hal!ncoast!allbery
From: allbery@ncoast.UUCP (Brandon Allbery)
Newsgroups: comp.unix.wizards
Subject: Re: #! magic number
Message-ID: <2794@ncoast.UUCP>
Date: Sun, 5-Jul-87 17:50:29 EDT
Article-I.D.: ncoast.2794
Posted: Sun Jul  5 17:50:29 1987
Date-Received: Tue, 7-Jul-87 00:46:53 EDT
References:  > <2211@bunker.UUCP> <1097@mtune.ATT.COM> <488@quacky.UUCP> <1792@ttrdc.UUCP>
Reply-To: allbery@ncoast.UUCP (Brandon Allbery)
Followup-To: comp.unix.wizards
Organization: Cleveland Public Access UN*X, Cleveland, Oh
Lines: 47

As quoted from <1792@ttrdc.UUCP> by levy@ttrdc.UUCP (Daniel R. Levy):
+---------------
| In article <488@quacky.UUCP>, dce@mips.UUCP (David Elliott) writes:
| < In article <1788@ttrdc.UUCP> levy@ttrdc.UUCP (Daniel R. Levy) writes:
| < >In article <7180@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes:
| < >< And indeed, it does more:
| < >< 	% egrep uucp:: /etc/passwd
| < >< 	uucp::16:16:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/lib/uucp/recording
| < >< 	% cat /usr/lib/uucp/recording
| < >< 	#! /bin/awk NR > 1 { print }
| < ><		[message] 
| < >This is like using a cannon to kill a gopher.
| < >Why not
| < >
| < >/bin/cat << !
| < >	[message]
| < >!
| < >which will also work on systems other than "Berserkeley" UNIX.
| < What? You mean that your /etc/password will allow you to put multiple
| < lines in the shell field? What you suggest is that
| < 	uucp::16:..:/bin/cat << !
| < 		[message]
| < is a valid entry in the password file.
| 
| No, no, that's not what I meant.  I meant to use a script containing that text.
+---------------

Unfortunately, while /bin/login uses execlp, /bin/su seems to use execl.  As
a result, I've been forced to make su-able shells by linking /bin/sh to another
name and checking for "-name" in /etc/profile.  (Not that you'd want to do
a "su - uucp".)

Also, using execlp raises the question of how to execute a csh script from
/etc/passwd?  (Which may not mean much to you, but csh is d*mned near the
standard shell for BSD.)

++Brandon
-- 
       ---- Moderator for comp.sources.misc and comp.binaries.ibm.pc ----
Brandon S. Allbery	!cbosgd!ncoast!allbery (NOW!!!!)
aXcess Company		{ames,mit-eddie,harvard,talcott}!necntc!ncoast!allbery
6615 Center St. #A1-105	{well,sun,pyramid,ihnp4}!hoptoad!ncoast!allbery
Mentor, OH 44060-4101	necntc!ncoast!allbery@harvard.HARVARD.EDU (Internet)
+01 216 974 9210	ncoast!allbery@CWRU.EDU (CSnet -- if you dare)
NCOAST ADMIN GROUP	Brandon Allbery on 157/504 (Fidonet/Matrix/whatever)
* ncoast -- Public Access UN*X -- (216) 781-6201, 24 hrs., 300/1200/2400 baud *
 * ncoast is proud to be carrying alt.all -- contact me for more information *