Run the privileged dhclient process in its own session.

In the MPSAFE TTY branch, I noticed PTY's to be leaked, because
dhclient's privileged process was run inside the session of, say, the
login shell. Make sure we call setsid() here.

Approved by:	philip (mentor), brooks
This commit is contained in:
ed 2008-06-30 20:23:49 +00:00
parent 77ca9e76cd
commit 0637892261

View File

@ -2612,6 +2612,7 @@ fork_privchld(int fd, int fd2)
setproctitle("%s [priv]", ifi->name);
setsid();
dup2(nullfd, STDIN_FILENO);
dup2(nullfd, STDOUT_FILENO);
dup2(nullfd, STDERR_FILENO);