|
|
Question : getting uid & euid of a process
|
|
How is it possible to get the real & effective user id of a given process?
The idea is to call something like geteuid(), from inside a c program, to get the effective user id of ANOTHER process (let's say the father).
|
Answer : getting uid & euid of a process
|
|
You can't. It can change (setreuid(), setuid()) and you must be root to read kmem on older vmunix's (that do not have /proc).
You can get a guess on systems that support /proc, but it could change in the next instruction. What are you really trying to do?
If you want a process to prove it is running as a User you _can_ do that with 100% portable code -- but it'll cost you points.
|
|
|
|
|