summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-09-06 13:53:08 +0100
committerRoy Marples <roy@marples.name>2020-09-06 13:53:08 +0100
commit6556019a6dc8f79dd5c235817cf95b98139b4eb4 (patch)
tree03a790444b156b2e72f113bff8db126e89955645 /src/dhcpcd.c
parent8f4e3268eae80ed4cd53520cb36c228f127d0fcd (diff)
downloaddhcpcd-6556019a6dc8f79dd5c235817cf95b98139b4eb4.tar.xz
privsep: dump leases in a sandbox
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index efbd672b..ba0c905a 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -2198,6 +2198,14 @@ printpidfile:
ctx.control_fd = control_open(NULL, AF_UNSPEC,
ctx.options & DHCPCD_DUMPLEASE);
if (ctx.control_fd != -1) {
+#ifdef PRIVSEP
+ ctx.options &= ~DHCPCD_FORKED;
+ if (IN_PRIVSEP(&ctx) && ps_mastersandbox(&ctx) == -1) {
+ ctx.options |= DHCPCD_FORKED;
+ goto exit_failure;
+ }
+ ctx.options |= DHCPCD_FORKED;
+#endif
if (!(ctx.options & DHCPCD_DUMPLEASE))
loginfox("sending commands to dhcpcd process");
len = control_send(&ctx, argc, argv);