]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Don't run the CHROOT hook if we can't init privsep.
authorRoy Marples <roy@marples.name>
Mon, 10 Feb 2020 22:08:26 +0000 (22:08 +0000)
committerRoy Marples <roy@marples.name>
Mon, 10 Feb 2020 22:08:26 +0000 (22:08 +0000)
src/dhcpcd.c

index 4e3bf07609b7a0370f61ad388a17af13844b91ae..a306bd6fd1964c7d72d9193620153d511d04903d 100644 (file)
@@ -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