Bug 684069

Summary: SELinux is preventing /bin/systemctl from 'unlink' accesses on the lnk_file /etc/systemd/system/multi-user.target.wants/ntpd.service.
Product: [Fedora] Fedora Reporter: Horst H. von Brand <vonbrand>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: dwalsh, juanfr, luya, mgrepl, trevor.davenport
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:c0584801e186cb7c001af0ef2d787c025ba8b38c2b12024b286ca47ba2532fd8
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-07 12:08:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Horst H. von Brand 2011-03-11 01:58:27 UTC
SELinux is preventing /bin/systemctl from 'unlink' accesses on the lnk_file /etc/systemd/system/multi-user.target.wants/ntpd.service.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow systemctl to have unlink access on the ntpd.service lnk_file
Then you need to change the label on /etc/systemd/system/multi-user.target.wants/ntpd.service
Do
# semanage fcontext -a -t FILE_TYPE '/etc/systemd/system/multi-user.target.wants/ntpd.service'
where FILE_TYPE is one of the following: locale_t. 
Then execute: 
restorecon -v '/etc/systemd/system/multi-user.target.wants/ntpd.service'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

If you believe that systemctl should be allowed unlink access on the ntpd.service lnk_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 systemctl /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:gnomeclock_t:s0-s0:c0.c1023
Target Context                system_u:object_r:etc_t:s0
Target Objects                /etc/systemd/system/multi-
                              user.target.wants/ntpd.service [ lnk_file ]
Source                        systemctl
Source Path                   /bin/systemctl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-units-20-1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-1.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38-0.rc8.git0.1.fc15.x86_64 #1 SMP Tue Mar 8
                              08:22:15 UTC 2011 x86_64 x86_64
Alert Count                   6
First Seen                    Thu 10 Mar 2011 07:47:23 PM CLST
Last Seen                     Thu 10 Mar 2011 07:54:00 PM CLST
Local ID                      1fbd3acd-dc5d-47e6-91c3-b622351196b4

Raw Audit Messages
type=AVC msg=audit(1299797640.468:139): avc:  denied  { unlink } for  pid=2583 comm="systemctl" name="ntpd.service" dev=dm-0 ino=36 scontext=system_u:system_r:gnomeclock_t:s0-s0:c0.c1023 tcontext=system_u:object_r:etc_t:s0 tclass=lnk_file


type=SYSCALL msg=audit(1299797640.468:139): arch=x86_64 syscall=unlink success=no exit=EACCES a0=cc8ad0 a1=7fff992e9e30 a2=0 a3=742e726573752d69 items=0 ppid=2581 pid=2583 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemctl exe=/bin/systemctl subj=system_u:system_r:gnomeclock_t:s0-s0:c0.c1023 key=(null)

Hash: systemctl,gnomeclock_t,etc_t,lnk_file,unlink

audit2allow

#============= gnomeclock_t ==============
allow gnomeclock_t etc_t:lnk_file unlink;

audit2allow -R

#============= gnomeclock_t ==============
allow gnomeclock_t etc_t:lnk_file unlink;

Comment 1 Miroslav Grepl 2011-03-11 11:20:29 UTC
*** Bug 684068 has been marked as a duplicate of this bug. ***

Comment 2 Horst H. von Brand 2011-03-11 12:14:03 UTC
Sideways question: abrt is able to detect duplicates, why doesn't SELinux use the same "backend" for reporting?

Comment 3 Miroslav Grepl 2011-03-11 12:39:41 UTC
sealert does it (but other way). These are different bugs for SELinux but I know where the problem is so I marked them as duplicate.

Comment 4 Miroslav Grepl 2011-04-07 12:03:47 UTC
*** Bug 675278 has been marked as a duplicate of this bug. ***

Comment 5 Miroslav Grepl 2011-04-07 12:08:27 UTC

*** This bug has been marked as a duplicate of bug 675278 ***