]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
privsep: Fix prior so we init
authorRoy Marples <roy@marples.name>
Thu, 9 Jan 2020 15:52:41 +0000 (15:52 +0000)
committerRoy Marples <roy@marples.name>
Thu, 9 Jan 2020 15:52:41 +0000 (15:52 +0000)
src/privsep.c

index fb0a85b6ce3a9cbc6652c83aa1116820b2141324..8ff34a25364b4a85264e04e9bc88265a52ffa22a 100644 (file)
@@ -94,6 +94,8 @@ ps_init(struct dhcpcd_ctx *ctx)
                logerr("chown `%s'", DBDIR);
        if (chown(RUNDIR, pw->pw_uid, gid) == -1)
                logerr("chown `%s'", RUNDIR);
+
+       ctx->options |= DHCPCD_PRIVSEP;
        return 0;
 }
 
@@ -142,7 +144,6 @@ ps_dostart(struct dhcpcd_ctx *ctx,
                *priv_pid = pid;
                *priv_fd = fd[0];
                close(fd[1]);
-               ctx->options |= DHCPCD_PRIVSEP;
                if (recv_unpriv_msg != NULL &&
                    eloop_event_add(ctx->eloop, *priv_fd,
                    recv_unpriv_msg, recv_ctx) == -1)
@@ -153,7 +154,7 @@ ps_dostart(struct dhcpcd_ctx *ctx,
                return pid;
        }
 
-       ctx->options |= DHCPCD_PRIVSEP | DHCPCD_UNPRIV | DHCPCD_FORKED;
+       ctx->options |= DHCPCD_UNPRIV | DHCPCD_FORKED;
        if (ctx->fork_fd != -1) {
                close(ctx->fork_fd);
                ctx->fork_fd = -1;