summaryrefslogtreecommitdiffabout
path: root/src/sentinel.c
authorSergey Poznyakoff <gray@gnu.org>2018-05-17 18:37:57 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2018-05-17 18:37:57 (GMT)
commit41e4cf7b5ad33dcfc7f472b9392831fa197fd8e2 (patch) (side-by-side diff)
tree6efb7211f656932b6e1848fba21e3c71fb704819 /src/sentinel.c
parente8e7bbc7de3355af2c14992e09e0881e95b8b580 (diff)
downloadgenrc-41e4cf7b5ad33dcfc7f472b9392831fa197fd8e2.tar.gz
genrc-41e4cf7b5ad33dcfc7f472b9392831fa197fd8e2.tar.bz2
Implement the --user and --group options.
Diffstat (limited to 'src/sentinel.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/sentinel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 1d44763..59b89cc 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -140,24 +140,26 @@ start_command(int p[])
xpipe(errpipe);
xpipe(outpipe);
pid = fork();
if (pid == -1) {
system_error(errno, "pipe");
return -1;
}
if (pid == 0) {
char *argv[] = { SHELL, "-c", NULL, NULL };
int i;
+ runas();
+
close(0);
close(1);
close(2);
open("/dev/null", O_RDWR);
dup(outpipe[1]);
dup(errpipe[1]);
i = max(max(outpipe[0],outpipe[1]),
max(errpipe[0],errpipe[1]));
while (--i > 2)
close(i);

Return to:

Send suggestions and report system problems to the System administrator.