Bug 18817

Summary: possible file descriptor leak in dhclient(8)
Product: Base System Reporter: Archie Cobbs <archie>
Component: binAssignee: Murray Stokely <murray>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.4-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Archie Cobbs 2000-05-25 21:40:00 UTC
	It appears that the function read_client_leases() in dhclient(8)
	clparse.c contains a file descriptor leak. The FILE *cfile is
	never fclose()'d.

	Also, when the dhclient-script is exec'd, we don't want any open
	file descriptors in the dhclient(8) process to be inherited by
	the child process (i.e., the script). So dhclient should be doing
	an ``fcntl(fileno(fp), F_SETFD, 1)'' for every FILE* it opens that
	can possibly still be open when the script is executed (e.g, the
	lease file).

How-To-Repeat: 
	Was determined by inspection; this could all be wrong.
Comment 1 Murray Stokely freebsd_committer freebsd_triage 2002-02-19 09:11:19 UTC
State Changed
From-To: open->analyzed

I believe this bug still exists in our existing dhclient(8), but it 
has been fixed in ISC DHCP 3.X.  I will be importing 3.0.1rc6 to 
-CURRENT shortly. 



Comment 2 Murray Stokely freebsd_committer freebsd_triage 2002-02-19 09:11:19 UTC
Responsible Changed
From-To: freebsd-bugs->murray

I will import DHCP 3.0.1rc6 shortly, which will fix this bug.
Comment 3 Murray Stokely freebsd_committer freebsd_triage 2002-04-14 14:13:11 UTC
State Changed
From-To: analyzed->closed

DHCP 3.0.1RC8 has been imported to both -CURRENT and -STABLE.  This 
newer version properly closes the file when it is done with it.