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
signature.asc
Description: PGP signature
