Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Nov 2017 08:54:23 +0000 (UTC)
From:      Mariusz Zaborski <oshogbo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r325741 - head/sbin/dhclient
Message-ID:  <201711120854.vAC8sN5n015111@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.
  
  Reviewed by:	cem@
  Differential Revision:	https://reviews.freebsd.org/D12826

Modified:
  head/sbin/dhclient/dhclient.c

Modified: head/sbin/dhclient/dhclient.c
==============================================================================
--- head/sbin/dhclient/dhclient.c	Sun Nov 12 08:42:43 2017	(r325740)
+++ head/sbin/dhclient/dhclient.c	Sun Nov 12 08:54:23 2017	(r325741)
@@ -2423,7 +2423,7 @@ go_daemon(void)
 	/* Stop logging to stderr... */
 	log_perror = 0;
 
-	if (daemon(1, 0) == -1)
+	if (daemon(1, 1) == -1)
 		error("daemon");
 
 	cap_rights_init(&rights);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711120854.vAC8sN5n015111>