Subject: setuid() or seteuid()?
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: Mike Long <mike.long@analog.com>
List: current-users
Date: 12/19/1993 01:03:24
Why has the function for changing the effective user-id changed from
setuid() to seteuid()?  Is it a change that stems from POSIX or what
BSD4.4 does?

Any program that calls setuid() to change the effective UID only
(i.e., any setuid SYSV program) will either change both the effective
AND the real UID, or fail because of insufficient privileges.  Either
way, it will break.  Specifically, C-Kermit (both 5A(189) and 5A(190))
will break unless you use -DSETREUID.  You may want to avoid
setreuid() because it is a BSD4.3 compatibility syscall, and may go
away if someone doesn't include 'options "COMPAT_43"' in their kernel 
config file (will it?).
-- 
Mike Long                                         Mike.Long@Analog.com
VLSI Design Engineer                              voice: (617)461-4030
Analog Devices, SPD Div.                            FAX: (617)461-3010
Norwood, MA 02062                            *this = !opinion(Analog);

------------------------------------------------------------------------------