src/main.c | 3 +++
1 file changed, 3 insertions(+)
New commits:
commit cffb3056b959a23444632c9473f75ba9980052d8
Author: David Teigland <teigland(a)redhat.com>
Date: Thu Jun 14 10:48:15 2012 -0500
daemon: skip setup_groups when no -U or -G
setting up groups uses user name and gid.
Signed-off-by: David Teigland <teigland(a)redhat.com>
diff --git a/src/main.c b/src/main.c
index abc35fd..e9d8f40 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1188,6 +1188,9 @@ static void setup_groups(void)
int pngroups, sngroups, ngroups_max;
gid_t *pgroup, *sgroup;
+ if (!com.uname || !com.gname)
+ return;
+
ngroups_max = sysconf(_SC_NGROUPS_MAX);
if (ngroups_max < 0) {
log_error("cannot get the max number of groups %i", errno);