summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-10-07 14:37:35 +0100
committerRoy Marples <roy@marples.name>2020-10-07 14:37:35 +0100
commitd047f2dd0d9cee881d1d3e56da8ba67664f7726d (patch)
tree5cf0e8409af49ce16e10f0661a76b2e9e016740d /src/privsep.c
parente2caea689681e9e2f9291290939390ea7d12b2f9 (diff)
downloaddhcpcd-d047f2dd0d9cee881d1d3e56da8ba67664f7726d.tar.xz
privsep: Only log chrooting from the launcher process
And the sandbox tech as well. Rework stop_interface so we can reuse an option for marking a process as the launcher.
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/privsep.c b/src/privsep.c
index d1c74f4a..771e7317 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -116,7 +116,7 @@ ps_dropprivs(struct dhcpcd_ctx *ctx)
{
struct passwd *pw = ctx->ps_user;
- if (!(ctx->options & DHCPCD_FORKED))
+ if (ctx->options & DHCPCD_LAUNCHER)
logdebugx("chrooting as %s to %s", pw->pw_name, pw->pw_dir);
if (chroot(pw->pw_dir) == -1 &&
(errno != EPERM || ctx->options & DHCPCD_FORKED))
@@ -566,7 +566,7 @@ ps_mastersandbox(struct dhcpcd_ctx *ctx, const char *_pledge)
}
logerr("%s: %s", __func__, sandbox);
return -1;
- } else if (!forked)
+ } else if (ctx->options & DHCPCD_LAUNCHER)
logdebugx("sandbox: %s", sandbox);
return 0;
}