From: Roy Marples Date: Mon, 10 Feb 2020 22:08:26 +0000 (+0000) Subject: privsep: Don't run the CHROOT hook if we can't init privsep. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaf099b3e5caaa11b2034ea82fe4c192e81e2ce8;p=thirdparty%2Fdhcpcd.git privsep: Don't run the CHROOT hook if we can't init privsep. --- 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