summaryrefslogtreecommitdiffstats
path: root/src/privsep-root.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-30 21:13:45 +0100
committerRoy Marples <roy@marples.name>2020-04-30 21:13:45 +0100
commit949d0f9aee6aefa461c949262202af12fa8143cf (patch)
treea5b0bd6b799e59714196e5774b67f239c7162b86 /src/privsep-root.c
parent257dae21343e899ad2667aac9b981fa427b7541b (diff)
downloaddhcpcd-949d0f9aee6aefa461c949262202af12fa8143cf.tar.xz
privsep: Add --chroot configurable
Overrides the directory to chroot to away from the privilege separation users home directory.
Diffstat (limited to 'src/privsep-root.c')
-rw-r--r--src/privsep-root.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/privsep-root.c b/src/privsep-root.c
index a2aa1448..c3b95e24 100644
--- a/src/privsep-root.c
+++ b/src/privsep-root.c
@@ -220,8 +220,7 @@ ps_root_docopychroot(struct dhcpcd_ctx *ctx, const char *file)
struct timeval tv[2];
#endif
- if (snprintf(path, sizeof(path), "%s/%s",
- ctx->ps_user->pw_dir, file) == -1)
+ if (snprintf(path, sizeof(path), "%s/%s", ctx->ps_chroot, file) == -1)
return -1;
if (stat(file, &from_sb) == -1)
return -1;