Can you explain me the meaning of effective and real uid

Can you explain me the meaning of effective and real uid

Post by Efi Merdle » Sat, 10 Jul 1999 04:00:00



Hi

Can you explain me the meaning of effective and real uid ?

I know that there are other types of uid like fs and saved,what is the
difference between all four of them ?

Thank you

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

 
 
 

Can you explain me the meaning of effective and real uid

Post by Josh Ste » Sat, 10 Jul 1999 04:00:00



Quote:>Can you explain me the meaning of effective and real uid ?

The real id when a user logs in is the real id of the user.
When another process is initiated by a process of this user,
the other process has the same real id.  The effective id
and effective group id
of a process normally determine the permissions that it has at that
time.  The fs id gives basically gives additional granularity to
this access control
A process can always change its effective id or effective
group id to its real id or group id with a system call.  
process can have an effective
id that is different from its real id when, for instance, it
runs a program with the setuid bit set in the file permissions
of the executable.  In that case, the effective id/effective gid
of the process exec'ing the program is initially set to the
owner/group of the file (depending on which bits were set in
the executable).

Running as real id or effective id of root gives additional
permissions to change things.  Look at the man pages for
setuid, seteuid, setreuid, setfsuid, setgid, seteguid, setregid,
etc. for more (accurate) information.

- Josh

 
 
 

Can you explain me the meaning of effective and real uid

Post by Kurt Wa » Mon, 12 Jul 1999 04:00:00




>>Can you explain me the meaning of effective and real uid ?

>The real id when a user logs in is the real id of the user.

The real UID and GID are read from /etc/passwd at login.

Quote:>When another process is initiated by a process of this user,
>the other process has the same real id.  The effective id
>and effective group id
>of a process normally determine the permissions that it has at that
>time.  The fs id gives basically gives additional granularity to
>this access control

Normally, the real and effective UID/GID are the same.   If a program has
its setuid or setguid bit set, the effective UID/GID will be that of the
program owner, and the real UID/GID will be that of the UID executing the
binary, as the the paragraph below states.

Quote:>A process can always change its effective id or effective
>group id to its real id or group id with a system call.  
>process can have an effective
>id that is different from its real id when, for instance, it
>runs a program with the setuid bit set in the file permissions
>of the executable.  In that case, the effective id/effective gid
>of the process exec'ing the program is initially set to the
>owner/group of the file (depending on which bits were set in
>the executable).

>Running as real id or effective id of root gives additional
>permissions to change things.  Look at the man pages for
>setuid, seteuid, setreuid, setfsuid, setgid, seteguid, setregid,
>etc. for more (accurate) information.

Kurt
--
The trouble with you
Is the trouble with me.
Got two good eyes
But we still don't see.
                -- Robert Hunter, "Workingman's Dead"
 
 
 

1. effective UID vs. Real UID with su - problem

Experts,

The situation is :
---------------------------------------------------------------------------
sunfire{/home/dxsnezhk}# id
uid=60144(dxsnezhk) gid=1(other)
sunfire{/home/dxsnezhk}# /usr/xpg4/bin/id -u -nr
dxsnezhk
sunfire{/home/dxsnezhk}# whoami
dxsnezhk
sunfire{/home/dxsnezhk}# who am i
dxsnezhk   pts/1        Mar 31 11:06    (10.4.242.8)
sunfire{/home/dxsnezhk}# su -
Password:
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
You have new mail.
sunfire{/}# id
uid=0(root) gid=1(other)
sunfire{/}# /usr/xpg4/bin/id -u -nr
root
sunfire{/}# whoami
root
sunfire{/}# who am i
dxsnezhk   pts/1        Mar 31 11:06    (10.4.242.8)
sunfire{/}# passwd
passwd:  Changing password for dxsnezhk
New password:
sunfire{/}#
---------------------------------------------------------------------------

As you can see, even with su -      my real UID does not change for
some commands? I am coming from HP-UX background and I expect EUID ==
RUID upon
su - . Also, I don't understand why id and who command report
different values. What am I missing ?

Thanks.
Dimitry.

2. Adaptec CLONE ISA SCSI, RH5.2?

3. setuid to a non-root uid for both effective&real uid

4. GCC problem -FAQ doesn't help

5. Effective and Real UID and GID

6. mini-PCI Cards dont work

7. Effective vs. Real UIDs

8. PPP Connection problem

9. real- and effective uid woes

10. effective and real uids

11. UID / effective UID problem

12. Set effective uid?

13. Spawning shells with different effective uid's