Bug 648995

Summary: Issues with cups socket
Product: Red Hat Enterprise Linux 5 Reporter: Orion Poplawski <orion>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: medium Docs Contact:
Priority: low    
Version: 5.5CC: dwalsh
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-11 14:51:50 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:

Description Orion Poplawski 2010-11-02 17:14:13 UTC
Description of problem:

System is updated with yum-cron.  After cups update, I got:

type=AVC msg=audit(1288716983.014:438796): avc:  denied  { connectto } for  pid=25455 comm="smbd" path="/var/run/cups/cups.sock" scontext=root:system_r:smbd_t:s0 tcontext=user_u:system_r:rpm_script_t:s0 tclass=unix_stream_socket

Tried restarting cups from ssh connection, now I get:

type=AVC msg=audit(1288717673.561:439250): avc:  denied  { connectto } for  pid=14483 comm="smbd" path="/var/run/cups/cups.sock" scontext=root:system_r:smbd_t:s0 tcontext=root:system_r:unconfined_t:s0-s0:c0.c1023 tclass=unix_stream_socket


srwxrwxrwx  root root root:object_r:cupsd_var_run_t    /var/run/cups/cups.sock

root:system_r:unconfined_t:SystemLow-SystemHigh root 17768 1  0 10:56 ? 00:00:01 cupsd

How do I get cupsd to run confined?

Version-Release number of selected component (if applicable):
selinux-policy-2.4.6-279.el5_5.1

Comment 1 Daniel Walsh 2010-11-02 19:06:21 UTC
Some how you ended up running cups as rpm_script_t

Try service cups restart

And it should run with the proper context.

ps -eZ |grep cups

Comment 2 Orion Poplawski 2010-11-02 19:25:48 UTC
I did restart cups, now it is "unconfined_t" as noted above.

Comment 3 Daniel Walsh 2010-11-02 19:28:58 UTC
Then your initrc scripts are mislabeled.

restorecon -R -v /etc/rc.d

Comment 4 Orion Poplawski 2010-11-02 19:36:37 UTC
Damn, I should have remembered that.  That did the trick.  Thanks.