[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Real and effective uid in setuid executable



On Sun, 2007-03-04 at 17:42 +0100, Sven Ekman wrote:
> Hello,
> 
> I have a setuid executable which is written in C.  Is
> there a system call with which I can get the uid of
> the calling user if the executable is setuid root?
> 
> If the executable is setuid to a non-root user,
> getuid() and geteuid() return the real and effective
> userid as expected.  If setuid root, both return "0".
> 
> Is there a good reason for this behaviour? A way to
> circumvent it? Or a very good reason not to try?
> 
> Thanks and regards,
> Sven
> 

As far as I know, root's uid is 0.

-- 
Szia:
                        Nyizsa.

----------------------------------------------------------------------
Click to compare & save $100's on medical insurance, free quote
http://tags.bluebottle.com/fc/CAaCMPJkonyEVWr5MsE5MJVkGiXT2rWK/



Reply to: