From: utzoo!decvax!duke!harpo!floyd!cmcl2!philabs!sdcsvax!stanonik
Newsgroups: net.unix-wizards
Title: root executing setuid programs
Article-I.D.: sdcsvax.32
Posted: Fri Dec 31 19:37:48 1982
Received: Sun Jan  2 01:41:51 1983


Why shouldn't root change uid like any user when exec'ing a
setuid program?  In the procedure getxfile in sys1.c (4.1bsd)
the following code appears:

	/*
	 * set SUID/SGID protections, if no tracing
	 */
	if ((u.u_procp->p_flag&STRC)==0) {
#ifndef	MELB
		if(u.u_uid != 0)
#endif
		{
			u.u_uid = uid;
			u.u_procp->p_uid = uid;
		}

So, root processes are exempt from changing uid.  Why?  This
can cause problems when a daemon which runs as root interacts
with uucp.  In particular, the arpanet daemons in bbn's tcp
software.

Thanks,
Ron Stanonik
ucbvax!sdcsvax!stanonik
or
stanonik@nprdc