Real and effective userids.

Conor P. Cahill cpcahil at virtech.UUCP
Mon Oct 2 13:34:35 AEST 1989


In article <2204 at hydra.gatech.EDU>, dvu at prism.gatech.EDU (Dinh Vu) writes:
> 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?
> 
> 	The real userid is the login id (the id from the passwd file), 
> 	and used for communication only.  The effective userid is used 
> 	for accounting and other stuves... 

The real userid is not the login id.   It is the numerical id of "the user"
that is running a process, as opposed to "the effective" id of the process
that is used to determine whether you can open, create, unlink, etc. a file.

The only place where there is a difference between the real and effective
user id's is when the user is running a setuid program that is owned by
another user (or when that setuid program runs a sub-program).

The reason for two id's is to allow the setuid programs to know who
is executing them and to give them the chance to set thier user id
back to the original id after some initial processing is done.

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.unix.wizards mailing list