Bug 245672 - /etc/cups/lpoptions left with wrong SELinux file context
/etc/cups/lpoptions left with wrong SELinux file context
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
7
athlon Linux
low Severity medium
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
:
Depends On:
Blocks: F8Target
  Show dependency treegraph
 
Reported: 2007-06-25 20:24 EDT by Kevin Crocker
Modified: 2008-06-16 21:42 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-06-16 21:42:40 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Kevin Crocker 2007-06-25 20:24:21 EDT
Description of problem:
setroubleshoot says that cupsd is vioating a SELinux setting - 2 ALERTS

setroubleshoot dialog inlined below

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
cupsd was broken - couldn't install printer - so I reinstalled cupsd via
Smart Package Manager - after this cupsd allowed printer install and test
page worked - then these two alerts surfaced


ALERT #1
Summary
    SELinux is preventing /usr/sbin/cupsd (cupsd_t) "create" to tmp
    (print_spool_t).

Detailed Description
    SELinux denied access requested by /usr/sbin/cupsd. It is not expected that
    this access is required by /usr/sbin/cupsd and this access may signal an
    intrusion attempt. It is also possible that the specific version or
    configuration of the application is causing it to require additional access.

Allowing Access
    Sometimes labeling problems can cause SELinux denials.  You could try to
    restore the default system file context for tmp, restorecon -v tmp If this
    does not work, there is currently no automatic way to allow this access.
    Instead,  you can generate a local policy module to allow this access - see
    http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385 Or you can disable
    SELinux protection altogether. Disabling SELinux protection is not
    recommended. Please file a http://bugzilla.redhat.com/bugzilla/enter_bug.cgi
    against this package.

Additional Information        

Source Context                system_u:system_r:cupsd_t:SystemLow-SystemHigh
Target Context                system_u:object_r:print_spool_t
Target Objects                tmp [ dir ]
Affected RPM Packages         cups-1.2.10-10.fc7
                              [application]filesystem-2.4.6-1.fc7 [target]
Policy RPM                    selinux-policy-2.6.4-14.fc7
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.catchall_file
Host Name                     desk104
Platform                      Linux desk104 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12
                              15:37:31 EDT 2007 i686 athlon
Alert Count                   1
First Seen                    Mon 25 Jun 2007 07:00:37 PM CDT
Last Seen                     Mon 25 Jun 2007 07:00:37 PM CDT
Local ID                      4217e4b9-dee4-4df7-b08f-df7c84b6d2fd
Line Numbers                  

Raw Audit Messages            

avc: denied { create } for comm="cupsd" egid=0 euid=0 exe="/usr/sbin/cupsd"
exit=-13 fsgid=0 fsuid=0 gid=0 items=0 name="tmp" pid=1917
scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 sgid=0
subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 suid=0 tclass=dir
tcontext=system_u:object_r:print_spool_t:s0 tty=(none) uid=0


ALERT #2
Summary
    SELinux is preventing /usr/sbin/cupsd (cupsd_t) "rename" to lpoptions
    (cupsd_etc_t).

Detailed Description
    SELinux denied access requested by /usr/sbin/cupsd. It is not expected that
    this access is required by /usr/sbin/cupsd and this access may signal an
    intrusion attempt. It is also possible that the specific version or
    configuration of the application is causing it to require additional access.

Allowing Access
    Sometimes labeling problems can cause SELinux denials.  You could try to
    restore the default system file context for lpoptions, restorecon -v
    lpoptions If this does not work, there is currently no automatic way to
    allow this access. Instead,  you can generate a local policy module to allow
    this access - see http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385
    Or you can disable SELinux protection altogether. Disabling SELinux
    protection is not recommended. Please file a
    http://bugzilla.redhat.com/bugzilla/enter_bug.cgi against this package.

Additional Information        

Source Context                system_u:system_r:cupsd_t:SystemLow-SystemHigh
Target Context                root:object_r:cupsd_etc_t
Target Objects                lpoptions [ file ]
Affected RPM Packages         cups-1.2.10-10.fc7 [application]
Policy RPM                    selinux-policy-2.6.4-14.fc7
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   plugins.catchall_file
Host Name                     desk104
Platform                      Linux desk104 2.6.21-1.3228.fc7 #1 SMP Tue Jun 12
                              15:37:31 EDT 2007 i686 athlon
Alert Count                   1
First Seen                    Mon 25 Jun 2007 07:11:10 PM CDT
Last Seen                     Mon 25 Jun 2007 07:11:10 PM CDT
Local ID                      fdaefabe-cb50-4dc9-95c9-fd6fe5fe65ef
Line Numbers                  

Raw Audit Messages            

avc: denied { rename } for comm="cupsd" dev=dm-0 egid=0 euid=0
exe="/usr/sbin/cupsd" exit=-13 fsgid=0 fsuid=0 gid=0 items=0 name="lpoptions"
pid=2861 scontext=system_u:system_r:cupsd_t:s0-s0:c0.c1023 sgid=0
subj=system_u:system_r:cupsd_t:s0-s0:c0.c1023 suid=0 tclass=file
tcontext=root:object_r:cupsd_etc_t:s0 tty=(none) uid=0
Comment 1 Tim Waugh 2007-06-26 08:43:31 EDT
What does 'rpm -V cups' say?
Comment 2 Kevin Crocker 2007-06-27 23:36:00 EDT
# rpm -V cups
SM5....T c /etc/cups/classes.conf
S.5....T c /etc/cups/cupsd.conf
S.5...GT c /etc/cups/lpoptions
S.5....T c /etc/cups/printers.conf
Comment 3 Tim Waugh 2007-06-28 05:33:29 EDT
What is the output (as root) of the following commands?:

1. ls -Zd /var/spool/cups/tmp
2. /sbin/restorecon -nv /etc/cups/lpoptions
Comment 4 Kevin Crocker 2007-06-28 07:16:07 EDT
# ls -Zd /var/spool/cups/tmp
drwxrwx--T  root lp system_u:object_r:print_spool_t  /var/spool/cups/tmp
# /sbin/restorecon -nv /etc/cups/lpoptions
/sbin/restorecon reset /etc/cups/lpoptions context root:object_r:cupsd_etc_t:s0-
>system_u:object_r:cupsd_rw_etc_t:s0

Comment 5 Tim Waugh 2007-06-28 08:16:23 EDT
I wonder if cupsd is leaving that file with the wrong context after replacing it
due to an IPP operation.
Comment 6 Kevin Crocker 2007-07-08 00:47:47 EDT
so what do I do now?
Comment 7 Tim Waugh 2007-07-09 05:09:51 EDT
/sbin/restorecon -v /etc/cups/lpoptions

But there is a bug somewhere that needs fixing.  You shouldn't need to do that.

Have you ever run 'lpoptions' as root on that system?  Perhaps to set a default
printer?
Comment 8 Tim Waugh 2007-07-09 10:41:06 EDT
Hmm, cupsPutFile() does seem to preserve the SELinux file context, so that isn't
where the context got lost.

That only really leaves the 'lpoptions' command and, I suppose, KDE if you are
using that...?
Comment 9 Kevin Crocker 2007-07-09 12:26:50 EDT
No, I've never typed/run lpoptions as root on this machine - nor do I run KDE.

I have tried to set a default printer - but I use the printer GUI control panel
and simply click the box that says "Make this printer the default" or something 
like that.

Comment 10 Bug Zapper 2008-05-14 09:16:47 EDT
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 11 Bug Zapper 2008-06-16 21:42:38 EDT
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. 
Fedora 7 is no longer maintained, which means that it will not 
receive any further security or bug fix updates. As a result we 
are closing this bug. 

If you can reproduce this bug against a currently maintained version 
of Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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