diff options
| author | Roy Marples <roy@marples.name> | 2020-09-06 03:01:49 +0100 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2020-09-06 03:01:49 +0100 |
| commit | 8bc2150dce5fa055b44816d4c6b9ca16f7a7df4b (patch) | |
| tree | 82dd1d6fdc1cd80ca6742197d34d06a5787e51b8 /src/dhcpcd.c | |
| parent | 71b878695ef0557a036fee35997e52cd1f3d2aea (diff) | |
| download | dhcpcd-8bc2150dce5fa055b44816d4c6b9ca16f7a7df4b.tar.xz | |
FreeBSD: Don't rights limit stderr
Otherwise some utils in scripts will error with insufficient
capabilities.
Diffstat (limited to 'src/dhcpcd.c')
| -rw-r--r-- | src/dhcpcd.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c index d5d67f64..9c47ca7c 100644 --- a/src/dhcpcd.c +++ b/src/dhcpcd.c @@ -2261,17 +2261,20 @@ printpidfile: ctx.fork_fd = fork_fd[1]; close(fork_fd[0]); #ifdef PRIVSEP_RIGHTS - if (ps_rights_limit_fd(fork_fd[1]) == -1 || - ps_rights_limit_fd(stderr_fd[1]) == 1) - { + if (ps_rights_limit_fd(fork_fd[1]) == -1) { logerr("ps_rights_limit_fdpair"); goto exit_failure; } #endif - /* Redirect stderr to the stderr socketpair. + /* + * Redirect stderr to the stderr socketpair. * Redirect stdout as well. * dhcpcd doesn't output via stdout, but something in - * a called script might. */ + * a called script might. + * + * Do NOT rights limit this fd as it will affect scripts. + * For example, cmp reports insufficient caps on FreeBSD. + */ if (dup2(stderr_fd[1], STDERR_FILENO) == -1 || dup2(stderr_fd[1], STDOUT_FILENO) == -1) logerr("dup2"); @@ -2310,7 +2313,8 @@ printpidfile: #endif setproctitle("[launcher]"); eloop_event_add(ctx.eloop, ctx.fork_fd, dhcpcd_fork_cb, &ctx); - eloop_event_add(ctx.eloop, ctx.stderr_fd, dhcpcd_stderr_cb, &ctx); + eloop_event_add(ctx.eloop, ctx.stderr_fd, dhcpcd_stderr_cb, + &ctx); goto run_loop; } |
