svn commit: r325741 - head/sbin/dhclient

Brooks Davis brooks at freebsd.org
Mon Nov 13 01:35:48 UTC 2017


On Sun, Nov 12, 2017 at 08:54:23AM +0000, Mariusz Zaborski wrote:
> Author: oshogbo
> Date: Sun Nov 12 08:54:23 2017
> New Revision: 325741
> URL: https://svnweb.freebsd.org/changeset/base/325741
> 
> Log:
>   dhclient(8) should not close stdio using daemon(3) function.
>   
>   dhclient(8) is chrooted so opening /dev/null always will fail.
>   In capability world this is also annoying because we getting error that
>   open(2) is not permitted in Capsicum. dhclient(8) is closing stdio by
>   precaching fd to /dev/null before chroot.
>   This is done few lines below daemon(3) function so let's not try to do that
>   in daemon(3) function.

This makes me wonder if there would be some sense in a syscall that
just creates a file descriptor morally equivalant to opening /dev/null.

A slightly crazy option would be to extend dup2 to treat some invalid
descriptor (-2?) as that.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20171113/f25197a2/attachment.sig>


More information about the svn-src-all mailing list