aboutsummaryrefslogtreecommitdiff
path: root/gmid.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2021-02-03 14:13:32 +0000
committerOmar Polo <op@omarpolo.com>2021-02-03 14:13:32 +0000
commit9edb82825145b2311c547003b9e7ca286ef7db3a (patch)
treef426e4d020d613ee1431c458bac2d81d97118dfa /gmid.c
parent4ee08bd14841bfa98575cce26e099cab50a1827d (diff)
drop privileges after the fork
Diffstat (limited to 'gmid.c')
-rw-r--r--gmid.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gmid.c b/gmid.c
index b52c5d5..b8467f4 100644
--- a/gmid.c
+++ b/gmid.c
@@ -568,7 +568,6 @@ main(int argc, char **argv)
/* setup tls before dropping privileges: we don't want user
* to put private certs inside the chroot. */
setup_tls();
- drop_priv();
signal(SIGPIPE, SIG_IGN);
signal(SIGCHLD, SIG_IGN);
@@ -595,11 +594,13 @@ main(int argc, char **argv)
case 0: /* child */
close(p[0]);
exfd = p[1];
+ drop_priv();
listener_main();
_exit(0);
default: /* parent */
close(p[1]);
+ drop_priv();
return executor_main(p[0]);
}
}