setuid(2) bug?

ScoMole #192-1232A jonl at sco.COM
Sat Feb 20 02:51:02 AEST 1988


+-I seem to recall ccement at rivm.UUCP (Martien F v Steenbergen) writing:
|
| According to the (System V) manuals from AT&T, Uniq, Nuxi and
| Xenix the chapter about the setuid(2) system call lists:
| 
| 	"...<Setuid> will fail if the real user ID of the
| 	calling process is not equal to <uid> and its effective
| 	user ID is not super-user. [EPERM]..."
| 
| If this is true, then the last command in the following sequence
| should be unsuccessful (assuming the use of legal user IDs):
| 
| 	< short program and exmaples deleted >
| 
| Comment please.
| 
| Martien.

Hmm. I tried out your example, and it appears that only one's effective uid
must be equal to "uid" in 'setuid (uid)', and the chmod u+s on the executeable
set that to be true. It seems to me that this is how it should work and the
documentation should be changed. off hand, i don't see any kind of security
problem with only checking for the effective uid instead of the real uid.
After all, who really needs to set their uid to what it already is?

if a fish's eye was a telephone pole, it would swim lopsided.
===============================================================================
jon luini || WORK: 408-425-7222    || HOME: 408-423-2917
Disclaimer|| You don't think SCO would agree with THAT, do you?????
Work:     || jonl at sco.com          || ...!{uunet, ihnp4, ucbvax!ucscc}!sco!jonl
Evil:     || niteowl at ssyx.ucsc.edu || ...!{ucbvax}!ucscc!ssyx!niteowl
===============================================================================



More information about the Comp.bugs.sys5 mailing list