Real and effective userids.

Chris Torek chris at mimsy.UUCP
Sun Oct 1 16:33:36 AEST 1989


In article <288 at bmers58.UUCP> davem at bmers58.UUCP (Dave Mielke) writes:
>Can anyone tell me what the "official" distinction is between the real
>userid and the effective userid of a process is? When a file is created
>its owner is set to the effective userid of the creating process,
>whereas when a file is accessed it would appear that the real userid of
>the accessing process is used when performing the authorization check.

The `raisin de eatery' (I never could spell in French :-) ) of the real
UID is to allow setuid programs to know who invoked them.  It is used
for virtually nothing else.%  It is up to setuid programs to do
authorisation tests, preferably by using setreuid() to swap IDs, doing
the operation, and using setreuid() to swap back.  (In SysV, where
setreuid() is not available, saved setuid works for everyone but root.)

The rest, obviously, depends on the setuid program.
-----
% access(), setuid(), setreuid(), and getuid() refer to the real uid.
  This is not guaranteed to be a complete list.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at cs.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list