commit 9edb82825145b2311c547003b9e7ca286ef7db3a from: Omar Polo date: Wed Feb 03 14:13:32 2021 UTC drop privileges after the fork commit - 4ee08bd14841bfa98575cce26e099cab50a1827d commit + 9edb82825145b2311c547003b9e7ca286ef7db3a blob - b52c5d5439571378ab5afe52c2ebc33902d31e14 blob + b8467f44cce1807bb798edb8f46fad397fb0312d --- gmid.c +++ 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]); } }