Bug 473148

Summary: selinux prevents cupsd from reading /etc/hosts
Product: [Fedora] Fedora Reporter: Warren Togami <wtogami>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: dwalsh, jkubin, mgrepl
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-11-27 12:27:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 188611    

Description Warren Togami 2008-11-26 19:47:40 UTC
cups-1.3.9-1.fc9.i386
selinux-policy-3.3.1-103.fc9.noarch

cupsd can be configured to point at a network printer by non-FQDN hostname, which attempts to read /etc/hosts and fails with a SELinux denial.

/etc/cups/printers.conf example (note the socket line):
<DefaultPrinter ws070lp>
Info 
Location something.example.com
DeviceURI socket://ws070:9100
State Stopped
StateMessage Unable to locate printer 'ws070.ltsp'!
StateTime 1227651710
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
</Printer>

type=AVC msg=audit(1227724974.326:1638): avc:  denied  { read } for  pid=2699 comm="cupsd" name="hosts" dev=dm-0 ino=37988257 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:dosfs_t:s0 tclass=file

Please verify that this is fixed in F10 and RHEL5 as well.

Comment 1 Daniel Walsh 2008-11-27 12:27:30 UTC
For some reason your /etc/hosts file is labeled dosfs_t. Did you mv it off of a usb key labeled dosfs_t?


restorecon /etc/hosts 

will fix.