Bug 852273

Summary: SELinux is preventing /sbin/usbhid-ups from 'unlink' accesses on the file usbhid-ups-UPS.pid.
Product: [Fedora] Fedora Reporter: Dan Ziemba <zman0900>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4974785787241f6d2f1ed425984778eeca916155572840c0b9ccad44485e5ed7
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-13 18:56:45 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 Dan Ziemba 2012-08-28 05:40:43 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.7-1.fc16.x86_64
time:           Tue 28 Aug 2012 01:40:03 AM EDT

description:
:SELinux is preventing /sbin/usbhid-ups from 'unlink' accesses on the file usbhid-ups-UPS.pid.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that usbhid-ups should be allowed unlink access on the usbhid-ups-UPS.pid file by default.
:Then you should report this as a bug.
:You can generate a local policy module to allow this access.
:Do
:allow this access for now by executing:
:# grep usbhid-ups /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:nut_upsdrvctl_t:s0
:Target Context                unconfined_u:object_r:var_run_t:s0
:Target Objects                usbhid-ups-UPS.pid [ file ]
:Source                        usbhid-ups
:Source Path                   /sbin/usbhid-ups
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           nut-2.6.5-1.fc16.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-90.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.7-1.fc16.x86_64 #1 SMP Mon Jul
:                              30 16:37:23 UTC 2012 x86_64 x86_64
:Alert Count                   1
:First Seen                    Tue 28 Aug 2012 01:38:37 AM EDT
:Last Seen                     Tue 28 Aug 2012 01:38:37 AM EDT
:Local ID                      520f148c-e88a-4197-af24-2e1ef682126d
:
:Raw Audit Messages
:type=AVC msg=audit(1346132317.265:156): avc:  denied  { unlink } for  pid=5615 comm="usbhid-ups" name="usbhid-ups-UPS.pid" dev="tmpfs" ino=494472 scontext=system_u:system_r:nut_upsdrvctl_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1346132317.265:156): arch=x86_64 syscall=unlink success=no exit=EACCES a0=1644990 a1=0 a2=1644b00 a3=0 items=0 ppid=5614 pid=5615 auid=4294967295 uid=57 gid=57 euid=57 suid=57 fsuid=57 egid=57 sgid=57 fsgid=57 tty=(none) ses=4294967295 comm=usbhid-ups exe=/sbin/usbhid-ups subj=system_u:system_r:nut_upsdrvctl_t:s0 key=(null)
:
:Hash: usbhid-ups,nut_upsdrvctl_t,var_run_t,file,unlink
:
:audit2allow
:
:#============= nut_upsdrvctl_t ==============
:allow nut_upsdrvctl_t var_run_t:file unlink;
:
:audit2allow -R
:
:#============= nut_upsdrvctl_t ==============
:allow nut_upsdrvctl_t var_run_t:file unlink;
:

Comment 1 Dan Ziemba 2012-08-28 05:43:00 UTC
This is happening when trying to execute `systemctl start nut-server.service` after installing and configuring nut.

Comment 2 Miroslav Grepl 2012-08-28 08:07:30 UTC
What does

# restorecon -R -v /var/run/nut

# ls -lZ /var/run/nut

Comment 3 Dan Ziemba 2012-08-28 09:13:47 UTC
ls -laZ /var/run/nut/
drwxr-x---. nut  nut  system_u:object_r:nut_var_run_t:s0 .
drwxr-xr-x. root root system_u:object_r:var_run_t:s0   ..
-rw-r--r--. nut  nut  system_u:object_r:nut_var_run_t:s0 upsd.pid
-rw-r--r--. root root system_u:object_r:nut_var_run_t:s0 upsmon.pid
srw-rw----. nut  nut  system_u:object_r:nut_var_run_t:s0 usbhid-ups-UPS
-rw-r--r--. nut  nut  system_u:object_r:nut_var_run_t:s0 usbhid-ups-UPS.pid


This bug is probably a side effect of https://bugzilla.redhat.com/show_bug.cgi?id=812825  I had to create /var/run/nut myself previously.  That's probably the reason it had bad context, so maybe this bug isn't actually valid.

Comment 4 Fedora End Of Life 2013-01-16 15:48:00 UTC
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. 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 '16'.

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 16'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 16 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, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

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.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Fedora End Of Life 2013-02-13 18:56:51 UTC
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 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.