Real and effective userids.

Conor P. Cahill cpcahil at virtech.UUCP
Sun Oct 1 11:54:07 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 real userid is the id of the person whom is running the program.  The 
effective userid is the id that is used to determine what the user can 
access.  However, in order to allow a setuid program to verify that the user
is allowed to perform a specific operation, the access(2) system call 
uses the real userid.

For most cases the real userid is equal to the effective user id.  running
a setuid program alters the effective user id for the duration of that 
process (unless the setuid program sets the effective id back to the real
user id). 


-- 
+-----------------------------------------------------------------------+
| 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