Bug 468984

Summary: SELinux is preventing consoletype (consoletype_t) "read" to /var/lib/dhclient/dhclient-ra0.leases (dhcpc_state_t).
Product: [Fedora] Fedora Reporter: Ralf Corsepius <rc040203>
Component: dhcpAssignee: David Cantrell <dcantrell>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: dcantrell, dwalsh, jkubin, lmacken, mfk.linux, mgrepl, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-12-06 23:15:32 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
full sealert none

Description Ralf Corsepius 2008-10-29 07:27:09 EDT
Created attachment 321787 [details]
full sealert

Description of problem:
I just found this SELinux alert:
...
SELinux is preventing consoletype (consoletype_t) "read" to
/var/lib/dhclient/dhclient-ra0.leases (dhcpc_state_t).
...

Version-Release number of selected component (if applicable):
selinux-policy-3.5.13-8.fc10.noarch
on an uptodate (2008-10-29) i386-rawhide system.

How reproducible:
No idea. I had been playing with system-config-network during the time when this alert popped up.
Comment 1 Daniel Walsh 2008-10-29 12:17:55 EDT
Leaked file descriptor in dhclient

Please call
fcntl(fd, F_SETFD, FD_CLOEXEC)
after opening the descriptor
Comment 2 David Cantrell 2008-10-29 19:36:03 EDT
The read_client_leases() function uses open(2) rather than fopen(3), which is probably why I looked past it when adding in the FD_CLOEXEC stuff.

I've modified the patch to use O_CLOEXEC on open(2) calls and add the 'e' character to the mode string in fopen(3) calls.  This works when you compile with -D_GNU_SOURCE.

While I'm pretty confident this fixes the problem you're seeing, I'm going to queue this build as an F-10 update.
Comment 3 David Cantrell 2008-10-29 19:45:24 EDT
I've built a new package as dhcp-4.0.0-31.fc10, here's the koji job:

http://koji.fedoraproject.org/koji/taskinfo?taskID=911385

I cannot create an F-10 update yet, so if you want to try out the packages now on rawhide, you can download them from the koji task page.
Comment 4 Fedora Update System 2008-11-04 20:13:09 EST
dhcp-4.0.0-31.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/dhcp-4.0.0-31.fc10
Comment 5 Fedora Update System 2008-11-22 11:46:07 EST
dhcp-4.0.0-32.fc10 has been pushed to the Fedora 10 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update dhcp'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/f10/FEDORA-2008-9915
Comment 6 Bug Zapper 2008-11-25 23:25:07 EST
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 7 David Cantrell 2008-12-01 18:30:33 EST
*** Bug 472923 has been marked as a duplicate of this bug. ***
Comment 8 mfk.linux 2008-12-04 13:05:16 EST
I tried to install the update listed in Comment #5 and terminal told me it found the update but did not install and when I tried the link given, I got a message saying the "path /updates/f10/FEDORA-2008-9915 cannot be found." Any suggestions?
Comment 9 Fedora Update System 2008-12-06 23:15:22 EST
dhcp-4.0.0-32.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.