Difference between UID and EUID
Hi all,
What is the difference between UID and EUID. Can anyone give me an example where the two have different values ? Thanks, Ash |
I mean when will be User Identification number different from effective user identification number ?
When setuid is used the suid will be set, along with suid will euid or uid change ? |
Effective UID is the one used for permission checks. The whole thing is a bit tricky: Linux supports both a Real UID and a Saved UID (actually, same with HP/UX and others unices). The point is that you cant just change to any EUID. Here are the rules:
- Changing to SUID or RUID is always ok - If you are root (UID 0), you can change to any UID. This will set both EUID, RUID and SUID. so is changing from root to any other UID) - RUID is set to according to your login. - EUID is different from RUID only when running Set UID programs, like su The point is that a Set UID program can switch between the UID of the user who invoked it, and the owner of the executable. A good description can be found in the info manual that comes with glibc (see process persona section) |
All times are GMT -5. The time now is 10:30 PM. |