Bug 473148 - selinux prevents cupsd from reading /etc/hosts
selinux prevents cupsd from reading /etc/hosts
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
9
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:
Environment:
Last Closed: 2008-11-27 07:27:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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
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 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.