setreuid() functionality in sysV
    Guy Middleton 
    gamiddleton at watmath.waterloo.edu
       
    Fri Jan 29 07:25:17 AEST 1988
    
    
  
In article <1962 at munnari.oz> kre at 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 at math.waterloo.edu, watmath!gamiddleton
    
    
More information about the Comp.unix.wizards
mailing list