diff options
| author | Roy Marples <roy@marples.name> | 2020-09-06 12:20:40 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-09-06 12:20:40 +0100 |
| commit | 887a28b736970e3c79a243f77986545cd56d62b1 (patch) | |
| tree | d4da27c7524873c153762fc33f71a48e9d55ba12 /src/privsep.c | |
| parent | c7047b246b43453c8ecd42154b608b6f899b8b9e (diff) | |
| download | dhcpcd-887a28b736970e3c79a243f77986545cd56d62b1.tar.xz | |
privsep: Dump leases from stdin in a limited sandbox
Diffstat (limited to 'src/privsep.c')
| -rw-r--r-- | src/privsep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/privsep.c b/src/privsep.c index 98d57857..5a10d26a 100644 --- a/src/privsep.c +++ b/src/privsep.c @@ -480,8 +480,9 @@ ps_mastersandbox(struct dhcpcd_ctx *ctx) } #ifdef PRIVSEP_RIGHTS - if (ps_rights_limit_ioctl(ctx->pf_inet_fd) == -1 || - ps_rights_limit_fd(ctx->link_fd) == -1 || + if ((ctx->pf_inet_fd != -1 && + ps_rights_limit_ioctl(ctx->pf_inet_fd) == -1) || + (ctx->link_fd != -1 && ps_rights_limit_fd(ctx->link_fd) == -1) || ps_rights_limit_stdio() == -1) { logerr("%s: cap_rights_limit", __func__); |
