From f7dcfcfa6e8188c9984bb3ee8ecd94394d0cbd21 Mon Sep 17 00:00:00 2001 From: psychon Date: Mon, 14 Jul 2008 08:58:54 +0000 Subject: [PATCH] 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 --- main.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 59fa7d98..e0c0d493 100644 --- a/main.cpp +++ b/main.cpp @@ -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;