Path: utzoo!mnetor!uunet!husc6!rutgers!clyde!watmath!gamiddleton From: gamiddleton@watmath.waterloo.edu (Guy Middleton) Newsgroups: comp.unix.wizards Subject: Re: setreuid() functionality in sysV Message-ID: <16600@watmath.waterloo.edu> Date: 28 Jan 88 21:25:17 GMT References: <1988Jan19.192854.3411@jarvis.csri.toronto.edu> <172@hudson.acc.virginia.edu> <1962@munnari.oz> Reply-To: gamiddleton@watmath.waterloo.edu (Guy Middleton) Organization: University of Waterloo [MFCF/ICR] Lines: 33 In article <1962@munnari.oz> kre@munnari.oz (Robert Elz) writes: > The Sys V developers at AT&T saw the need (correctly) for this facility, > (that is, real and effective uid switching) .. its been added to unix > ever since Waterloo (and probably others) did it in V6. > > However, they seem to have a real phobia about adding anything new, > so rather than add a new system call, which could have worked sanely, > without annoying limitations, they just added the internal, hidden, > saved set_user value, and allowed the old setuid() sys call to use > that whenever it wanted. As a point of information, here is the way it worked at Waterloo: Instead of two uids (real and effetive), there were three: real, effective, and effective-at-exec-time. This third uid (called the euid) was not directly settable, and was never (well, almost never) examined. Two new syscalls were provided -- schizo(), which would set the effective uid to either of the other two. become(), which would set the effective uid to an arbitrary value. It would only work if the effective-at-exec uid was zero [this was the only place the euid was looked at]. setuid() did the usual thing, except it left the euid unaffected. We don't use this any more. The BSD setreuid() makes it unnecessary. -Guy Middleton, University of Waterloo Institute for Computer Research gamiddleton@math.waterloo.edu, watmath!gamiddleton