projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
edc842a
)
exec plugin: Call `setgid' first so argitary groups can be configured.
author
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Fri, 31 Aug 2007 09:52:31 +0000
(11:52 +0200)
committer
Florian Forster
<octo@leeloo.lan.home.verplant.org>
Mon, 3 Sep 2007 12:45:31 +0000
(14:45 +0200)
src/exec.c
patch
|
blob
|
history
diff --git
a/src/exec.c
b/src/exec.c
index
e416c8f
..
e899a1c
100644
(file)
--- a/
src/exec.c
+++ b/
src/exec.c
@@
-146,14
+146,6
@@
static void exec_child (program_list_t *pl)
exit (-1);
}
exit (-1);
}
- status = setuid (uid);
- if (status != 0)
- {
- ERROR ("exec plugin: setuid failed: %s",
- sstrerror (errno, errbuf, sizeof (errbuf)));
- exit (-1);
- }
-
if (NULL != pl->group)
{
if ('\0' != *pl->group) {
if (NULL != pl->group)
{
if ('\0' != *pl->group) {
@@
-187,6
+179,14
@@
static void exec_child (program_list_t *pl)
sstrerror (errno, errbuf, sizeof (errbuf)));
exit (-1);
}
sstrerror (errno, errbuf, sizeof (errbuf)));
exit (-1);
}
+ } /* if (pl->group == NULL) */
+
+ status = setuid (uid);
+ if (status != 0)
+ {
+ ERROR ("exec plugin: setuid failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ exit (-1);
}
arg0 = strrchr (pl->exec, '/');
}
arg0 = strrchr (pl->exec, '/');