mirror of
https://github.com/znc/znc.git
synced 2026-06-24 12:01:56 +02:00
Replace usage of getresuid() with getuid() and geteuid()
getresuid() is a non-standard extension and is actually not defined on some (older) boxes. Since we gain nothing with also checking the saved user id, we can use this instead and, voila, znc compiles again. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1132 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -59,12 +59,8 @@ static void rehash(int sig) {
|
||||
}
|
||||
|
||||
static bool isRoot() {
|
||||
uid_t u_real, u_effective, u_saved;
|
||||
|
||||
getresuid(&u_real, &u_effective, &u_saved);
|
||||
|
||||
// User root? If one of these were root, we could switch the others to root, too
|
||||
if (u_real == 0 || u_effective == 0 || u_saved == 0)
|
||||
if (geteuid() == 0 || getuid() == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user