diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index e0e9328dd0..7917407bb2 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