Subject: Re: clearing suid/sgid bits upon ownership change
To: Rob Windsor <windsor@warthog.com>
From: Computo Ergo Checksum <greywolf@starwolf.starwolf.com>
List: current-users
Date: 12/09/1997 23:45:08
Rob Windsor sez:
/*
 * what it does:
 * 
 * Clears any suid or sgid bits if owner or group changes.  Even something
 * insane like clearing the suid bit if you change the group ownership.
 * 
 * 
 * what I think about it:
 * 
 * This sucks.  Please #ifdef it or change it so that this appears when
 * securelevel >1. I can't stand this behavior.  No other modern un*x in the
 * world does this insane crap.  I just love `surprises' like this in NetBSD --
 * not.

I agree with this.  The call shouldn't clear setuid when changing the group,
nor should it clear setgid when changing the owner.

More often than not have I been bit by this, although I will testify that
it's a carry-over from BSD 4.2; SunOS did away with it.

While we're at it, does POSIX_CHOWN_RESTRICTED exist as a sysctl (in
some form) yet?  It doesn't make sense to disallow chown()/fchown()
to a new _user_ if you don't have quotas compiled in, for example.

 * -- Rob
 */



				--*greywolf;
--
Have A Nice Day.  (Offer void where taxed or prohibited.)