System V Release 4 ...

Keith Bostic bostic at ucbvax.BERKELEY.EDU
Thu Oct 13 02:00:05 AEST 1988


In article <467 at gould.doc.ic.ac.uk>, brwk at doc.ic.ac.uk (Bevis King) writes:

> He believes that AT&T (or is it Sun - no can't be Sun, he worships the
> ground they walk on) have removed all setuid/setgid abilities from all
> shell scripts EVER. (PERIOD, FULL STOP, etc).

The current Berkeley distribution (4.3BSD-tahoe) does not allow setuid/gid
shell scripts.  The Volume 1, #59 posting to the comp.bugs.4bsd.ucb-fixes
newsgroup (attached) was a change to the kernel to disable them.  This is
because there was a security problem associated with shell scripts that we
thought could only be fixed by changing the semantics of shell scripts.
We have since found another method of fixing them, which will require
fairly major modifications to the system, so will probably not be posted as
a bug fix.  Setuid/gid scripts should be available in the next BSD release.

Keith Bostic

++++++++++++++++++++
Subject: setuid/setgid shell scripts are a security risk
Index: sys/kern_exec.c 4.3BSD

Description:
	Setuid/setgid shell scripts have inherent problems that
	may be used to violate security.  These problems cannot
	be fixed without completely revising the semantics of
	executable shell scripts.
Fix:
	Panel your office in asbestos, and apply the following patch
	to sys/kern_exec.c.

*** kern_exec.c.orig	Sun May 22 14:07:19 1988
--- kern_exec.c.new	Sun May 22 14:07:55 1988
***************
*** 180,185 ****
--- 180,187 ----
  		bcopy((caddr_t)ndp->ni_dent.d_name, (caddr_t)cfname,
  		    MAXCOMLEN);
  		cfname[MAXCOMLEN] = '\0';
+ 		uid = u.u_uid;
+ 		gid = u.u_gid;
  		goto again;
  	}
  



More information about the Comp.unix.wizards mailing list