From: Roy Marples Date: Thu, 9 Jan 2020 15:52:41 +0000 (+0000) Subject: privsep: Fix prior so we init X-Git-Tag: v9.0.0~125 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7713b7f3366418b4af7ed98eaafd9692898624e;p=thirdparty%2Fdhcpcd.git privsep: Fix prior so we init --- diff --git a/src/privsep.c b/src/privsep.c index fb0a85b6..8ff34a25 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -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;