[collectd] [PATCH] exec plugin: Don't pass an invalid egid to setgroups() if no group was given.
Sebastian Harl
sh at tokkee.org
Sun Feb 24 12:17:24 CET 2008
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 <sh at tokkee.org>
---
src/exec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/exec.c b/src/exec.c
index b25e769..20e65df 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -334,7 +334,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;
--
1.5.4.2.133.g3d51e
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080224/1f93520c/attachment.pgp
More information about the collectd
mailing list