summaryrefslogtreecommitdiffstats
path: root/src/privsep.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-05 07:47:14 +0100
committerRoy Marples <roy@marples.name>2020-04-05 07:47:14 +0100
commit5f42b70343bcae694748244e8aa0707aef690178 (patch)
treea7fa7e335a55be233d1a84ee675eb28ec855dcdb /src/privsep.c
parent2c6d5fe0653ba39d7cc41ddd0cdd35661d2a0df5 (diff)
downloaddhcpcd-5f42b70343bcae694748244e8aa0707aef690178.tar.xz
privsep: If we fail to init privsep, continue
We continue if the privsep user cannot be found, so do the same if passwd or similar is missing from the system. This helps people who use dhcpcd in ramdisks to oneshot the config for example to start iSCSI.
Diffstat (limited to 'src/privsep.c')
-rw-r--r--src/privsep.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/privsep.c b/src/privsep.c
index be4dc34e..f074ee2f 100644
--- a/src/privsep.c
+++ b/src/privsep.c
@@ -115,6 +115,7 @@ ps_init(struct dhcpcd_ctx *ctx)
/* If we pickup the _dhcp user refuse the default directory */
if (strcmp(pw->pw_dir, "/var/empty") == 0) {
+ ctx->options &= ~DHCPCD_PRIVSEP;
logerrx("refusing chroot: %s: %s", PRIVSEP_USER, pw->pw_dir);
errno = 0;
return -1;