summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-05-05 17:55:10 +0100
committerRoy Marples <roy@marples.name>2020-05-05 17:55:10 +0100
commitc0567cc03ec3a75d8edab2abb5789efda54d4c66 (patch)
treec49887a28a5ebee009a64e878999a9718cb6ece4 /src/dhcpcd.c
parent4934b0f3357194d28c57f6561d74442f4c7430e5 (diff)
downloaddhcpcd-c0567cc03ec3a75d8edab2abb5789efda54d4c66.tar.xz
privsep: Allow a blank string to force privsep users home directory
So FreeBSD users can set it like other OS's if they so choose.
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index 71ae45ac..060f2e93 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -1896,7 +1896,15 @@ main(int argc, char **argv)
break;
#ifdef PRIVSEP
case O_CHROOT:
- ctx.ps_chroot = optarg;
+#ifdef PRIVSEP_CHROOT
+ if (*optarg == '\0' ||
+ (((optarg[0] == '"' && optarg[1] == '"') ||
+ (optarg[0] == '\'' && optarg[1] == '\'')) &&
+ optarg[2] == '\0'))
+ ctx.ps_chroot = NULL;
+ else
+#endif
+ ctx.ps_chroot = optarg;
break;
#endif
case '?':