summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/IceGrid')
-rw-r--r--cpp/src/IceGrid/Activator.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp
index 2da76f782d7..2b48144cf03 100644
--- a/cpp/src/IceGrid/Activator.cpp
+++ b/cpp/src/IceGrid/Activator.cpp
@@ -683,7 +683,10 @@ Activator::activate(const string& name,
}
}
- if(initgroups(pw->pw_name, gid) == -1)
+ //
+ // Don't initialize supplementary groups if we are not running as root.
+ //
+ if(getuid() == 0 && initgroups(pw->pw_name, gid) == -1)
{
ostringstream os;
os << pw->pw_name;