Bug 1392443

Summary: systemctl returning Access denied for a non-existant service due to SELinux restrictions
Product: Red Hat Enterprise Linux 7 Reporter: Nenad Peric <nperic>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: lvrabec, mgrepl, mmalik, plautrba, pvrabec, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-14 14:10:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Nenad Peric 2016-11-07 14:11:10 UTC
Description of problem:

When trying to enable a service through systemd, which actually does not exist, systemctl will return Access Denied instead of a more useful No such file or directory.

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

selinux-policy-3.13.1-102.el7_3.4.noarch
systemd-219-30.el7_3.3.x86_64

How reproducible:
Everytime


Steps to Reproduce:
1. Try to enable a non-existant service
2. systemctl returns Access denied
3.

Actual results:

[root@galaxy ~]# systemctl enable foobar
Failed to execute operation: Access denied

[root@galaxy ~]# setenforce 0

[root@galaxy ~]# systemctl enable foobar
Failed to execute operation: No such file or directory 



Expected results:


Additional info:

Comment 1 Milos Malik 2016-11-07 14:19:11 UTC
The problem is already known:

* https://bugzilla.redhat.com/show_bug.cgi?id=1337041#c6

Comment 4 Lukas Vrabec 2016-11-14 14:10:47 UTC

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