Bug 680760

Summary: SELinux is preventing /bin/systemctl from 'create' accesses on the lnk_file ntpd.service.
Product: [Fedora] Fedora Reporter: John Watzke <watzkej>
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: cpanceac, dwalsh, fedora, icj, mgrepl, michael.wiktowy, michel, scampa.giovanni, stephent98
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:2492e870b5148f5b783936253cc5f4b56ef5fd361c082e71e5044b26284e8f51
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-27 22:49:58 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 John Watzke 2011-02-27 15:28:10 UTC
SELinux is preventing /bin/systemctl from 'create' accesses on the lnk_file ntpd.service.

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

If you want to allow systemctl to have create access on the ntpd.service lnk_file
Then you need to change the label on ntpd.service
Do
# semanage fcontext -a -t FILE_TYPE 'ntpd.service'
where FILE_TYPE is one of the following: locale_t. 
Then execute: 
restorecon -v 'ntpd.service'


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

If you believe that systemctl should be allowed create 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                ntpd.service [ lnk_file ]
Source                        systemctl
Source Path                   /bin/systemctl
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-units-18-1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.15-2.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38-0.rc6.git4.1.fc15.i686.PAE #1 SMP Fri Feb
                              25 04:16:45 UTC 2011 i686 i686
Alert Count                   1
First Seen                    Sun 27 Feb 2011 03:22:03 AM CST
Last Seen                     Sun 27 Feb 2011 03:22:03 AM CST
Local ID                      3a706d95-ceca-4361-ab3b-f1878748e58c

Raw Audit Messages
type=AVC msg=audit(1298798523.378:71): avc:  denied  { create } for  pid=2176 comm="systemctl" name="ntpd.service" 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(1298798523.378:71): arch=i386 syscall=symlink success=no exit=EACCES a0=987b1c0 a1=987b158 a2=987b158 a3=bf8b3f7f items=0 ppid=2136 pid=2176 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,create

audit2allow

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

audit2allow -R

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

Comment 1 Miroslav Grepl 2011-02-27 22:49:58 UTC

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