mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
Connect std{in,out,err} to *something* so that "hooks" scripts that write
to std{err,out} will not spam /etc/resolv.conf.
Ted Lemon fixed the problem in version 3 of the client, but only for the
pre-daemonized case. Thanks to Brian for pointing that out and helping
to make our future dhclient (v3) better.
Submitted by: brian
This commit is contained in:
parent
815d14ddab
commit
06cb5f26f7
1 changed files with 7 additions and 0 deletions
|
|
@ -2121,6 +2121,13 @@ int script_go (ip)
|
|||
wstatus = 0;
|
||||
}
|
||||
} else {
|
||||
if ((i = open(_PATH_DEVNULL, O_RDWR)) != -1) {
|
||||
dup2(i, STDIN_FILENO);
|
||||
dup2(i, STDOUT_FILENO);
|
||||
dup2(i, STDERR_FILENO);
|
||||
if (i > STDERR_FILENO)
|
||||
close(i);
|
||||
}
|
||||
execve (scriptName, argv, envp);
|
||||
error ("execve (%s, ...): %m", scriptName);
|
||||
exit (0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue