about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libmain/shared.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index e0e9328dd0ec..7917407bb2bd 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -178,7 +178,7 @@ void switchToNixUser()
 #if SETUID_HACK
 
     /* Don't do anything if this is not a setuid binary. */
-    if (getuid() == geteuid()) return;
+    if (getuid() == geteuid() && getgid() == getegid()) return;
 
     /* Here we set the uid and gid to the Nix user and group,
        respectively, IF the current (real) user is a member of the Nix