summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-02-10 22:08:26 +0000
committerRoy Marples <roy@marples.name>2020-02-10 22:08:26 +0000
commiteaf099b3e5caaa11b2034ea82fe4c192e81e2ce8 (patch)
tree6ea4bcc7fa043de41b6019fdb5c123e8fd98dc8c /src/dhcpcd.c
parent25d95a54fc2e80d395da7e380062de9a8a85c7be (diff)
downloaddhcpcd-eaf099b3e5caaa11b2034ea82fe4c192e81e2ce8.tar.xz
privsep: Don't run the CHROOT hook if we can't init privsep.
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index 4e3bf076..a306bd6f 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -2045,11 +2045,13 @@ printpidfile:
freopen(_PATH_DEVNULL, "r", stdin);
#ifdef PRIVSEP
- if (ps_init(&ctx) == -1 && errno != 0) {
- logerr("ps_init");
- goto exit_failure;
- }
- script_runchroot(&ctx, ifo->script);
+ if (ps_init(&ctx) == -1) {
+ if (errno != 0) {
+ logerr("ps_init");
+ goto exit_failure;
+ }
+ } else
+ script_runchroot(&ctx, ifo->script);
#endif
#ifdef USE_SIGNALS