Bug 473148 - selinux prevents cupsd from reading /etc/hosts
selinux prevents cupsd from reading /etc/hosts
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
Fedora Extras Quality Assurance
Depends On:
Blocks: K12LTSP
  Show dependency treegraph
Reported: 2008-11-26 14:47 EST by Warren Togami
Modified: 2008-11-27 07:27 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-11-27 07:27:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Warren Togami 2008-11-26 14:47:40 EST

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>
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

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 07:27:30 EST
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.

Note You need to log in before you can comment on or make changes to this bug.