rpc.lockd: Unconditionally close fds as daemon

When lockd is configured with a debug level of > 0 and foreground == 0,
the process is daemonized with a truth noclose argument to daemon().
This doesn't seem to be the desired behavior because that prevents
stdout and stderr from being closed, however, stdout and stderr aren't
used anywhere else. Furthermore, the man pages state that with a higher
debug level it will use the syslog facilities to do so.

Submitted by:	Caleb St. John
Discussed with:	rmacklem
MFC after:	3 days
Sponsored by:	iXsystems, Inc.
Differential Revision:	https://reviews.freebsd.org/D29415
This commit is contained in:
Caleb St. John 2021-03-26 14:00:14 -04:00 committed by Ryan Moeller
parent 0a7b99553f
commit badcfbacf3

View File

@ -426,7 +426,7 @@ main(int argc, char **argv)
* Note that it is NOT sensible to run this program from inetd - the
* protocol assumes that it will run immediately at boot time.
*/
if ((foreground == 0) && daemon(0, debug_level > 0)) {
if ((foreground == 0) && daemon(0, 0)) {
err(1, "cannot fork");
/* NOTREACHED */
}