[olsr-dev] getuid() and getgui() on startup

Kosta Welke (spam-protected)
Tue Jan 10 13:04:20 CET 2006


Andreas T√łnnesen wrote:

> Yes, I guess getgid is not really needed. Voila, it's gone in CVS.

Could you replace the getuid() with geteuid()? (Note the 'e')

This is because if you `chmod u+s` some file, then execute it, getuid() 
will still return your uid (RUID), while geteuid() will return the file 
owners uid (EUID). Of course, if you are root (EUID == 0), you can 
setuid(0), so that olsrd starts, but it would be easier if you'd just 
check for geteuid().

Man, do I feel nitpicking... :)

Kosta




More information about the Olsr-dev mailing list