Call daemon with 0 as first argument so that it changes the cwd to /.
authorflorian <florian@openbsd.org>
Sun, 19 Aug 2018 12:31:41 +0000 (12:31 +0000)
committerflorian <florian@openbsd.org>
Sun, 19 Aug 2018 12:31:41 +0000 (12:31 +0000)
commit83926339880de9648b94ba4943d1dbf509b83d99
treed9f7d0cedf93ff31b8805f09c03c26eb77713d4c
parent0e9ab5fb5e47840bce8f79ee1531370cd16de0dc
Call daemon with 0 as first argument so that it changes the cwd to /.
It is not a problem in slowcgi since it calls chroot(2) and then
chdir(2) shortly afterwards but hopefully prevents copying code into
daemons where it does matter.
Problem first observed by dlg in ntpd(8) which keeps sitting in the
directory from where it was started which might for example prevent an
unmount.
Discussed with deraadt@
usr.sbin/slowcgi/slowcgi.c