From: Sebastian Harl Date: Sun, 24 Feb 2008 11:17:24 +0000 (+0100) Subject: exec plugin: Don't pass an invalid egid to setgroups() if no group was given. X-Git-Tag: collectd-4.2.5~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ad05cf135ac41af52f761d21f9acd3cd07540c7e;p=collectd.git exec plugin: Don't pass an invalid egid to setgroups() if no group was given. In case that no group has been specified in the config file, egid = -1 used to be passed to setgroups() which, obviously, is not what we want. Signed-off-by: Sebastian Harl Signed-off-by: Florian Forster --- diff --git a/src/exec.c b/src/exec.c index b8b538b8..0ab259dc 100644 --- a/src/exec.c +++ b/src/exec.c @@ -187,7 +187,7 @@ static void exec_child (program_list_t *pl) glist[0] = gid; glist_len = 1; - if (gid != egid) + if ((gid != egid) && (egid != -1)) { glist[1] = egid; glist_len = 2;