Bug 439123 - selinux prevents cups for creating or deleting printer printer definition file
selinux prevents cups for creating or deleting printer printer definition file
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy-targeted (Show other bugs)
All Linux
low Severity low
: rc
: ---
Assigned To: Daniel Walsh
Depends On:
  Show dependency treegraph
Reported: 2008-03-26 23:57 EDT by Subhendu Ghosh
Modified: 2016-10-04 00:28 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-04-21 09:36:10 EDT
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 Subhendu Ghosh 2008-03-26 23:57:00 EDT
Description of problem:
Adding and removing a printer via system-config-printer generated a couple of
errors in SELinux permissions in permissive mode.

Version-Release number of selected component (if applicable):

How reproducible:
not very

Steps to Reproduce:
Actual results:

Source RPM Packages:  cups-1.2.4-11.15.el5
Policy RPM:  selinux-policy-2.4.6-121.el5
Selinux Enabled:  True
Policy Type:  targeted
MLS Enabled:  True
Enforcing Mode:  Permissive
Plugin Name:  catchall_file

First error on write:

Raw Audit Messages :

host=dakar-lap.lga.redhat.com type=AVC msg=audit(1206576283.185:130): avc:
denied { write } for pid=4194 comm="cupsd" name="hp.ppd" dev=dm-1 ino=789017
tcontext=user_u:object_r:cupsd_etc_t:s0 tclass=file 

host=dakar-lap.lga.redhat.com type=SYSCALL msg=audit(1206576283.185:130):
arch=40000003 syscall=5 success=yes exit=14 a0=bff6c106 a1=8241 a2=1b6 a3=8241
items=0 ppid=1 pid=4194 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0
sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="cupsd" exe="/usr/sbin/cupsd"
subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null) 

Second error on unlink:

Raw Audit Messages :

host=dakar-lap.lga.redhat.com type=AVC msg=audit(1206581650.167:248): avc:
denied { unlink } for pid=9972 comm="cupsd" name="hp.ppd" dev=dm-1 ino=789017
tcontext=user_u:object_r:cupsd_etc_t:s0 tclass=file 

host=dakar-lap.lga.redhat.com type=SYSCALL msg=audit(1206581650.167:248):
arch=40000003 syscall=10 success=yes exit=0 a0=bfd8ca08 a1=0 a2=51bff4
a3=bfd8ce08 items=0 ppid=1 pid=9972 auid=10418 uid=0 gid=0 euid=0 suid=0 fsuid=0
egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="cupsd" exe="/usr/sbin/cupsd"
subj=user_u:system_r:cupsd_t:s0-s0:c0.c1023 key=(null) 

Expected results:
success on both actions.

Additional info:
Have not been able to reproduce it.
Comment 1 Daniel Walsh 2008-03-28 09:49:59 EDT
Tim what is cups trying to do?  Is there a directory where cups creates printers
with system-config-printer?
Comment 2 Tim Waugh 2008-03-31 12:22:55 EDT
When cupsd is asked (by system-config-printer, or lpadmin, or any CUPS
management tool) to create or modify a printer it needs to create or modify a
file in /etc/cups/ppd/.  Each file in that directory represents a print queue,
and the correct context for those files is cupsd_rw_etc_t.

It looks like something has altered those files and left them with context
cupsd_etc_t -- I don't know why that would happen.
Comment 3 Subhendu Ghosh 2008-03-31 18:43:58 EDT
Perhaps as a result of adding CSB cups selector?  I will try to reproduce on a
virgin system.
Comment 4 Daniel Walsh 2008-04-01 02:24:45 EDT
So restorecon -R -v /etc/cups/ppd/ 

Should fix.  

Perhaps a tool is creating the files in a different directory and then renaming
or moving them there.

Comment 5 Daniel Walsh 2008-04-21 09:36:10 EDT
Closing as NOT A Bug, if it happens again, please reopen bugzilla.

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