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:
psychon
2008-07-14 08:58:54 +00:00
parent bf3acfe88a
commit f7dcfcfa6e
+1 -5
View File
@@ -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;