Bug 1594478

Summary: SELinux is preventing systemd from 'passwd_file_t' write
Product: [Fedora] Fedora Reporter: Marcin Skarbek <redhat>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dwalsh, lvrabec, mgrepl, plautrba, pmoore
Target Milestone: ---   
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: 2018-07-03 08:52:05 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:
Embargoed:

Description Marcin Skarbek 2018-06-23 12:40:53 UTC
Description of problem:
SElinux denies access to passwd file which conflicts with 'DynamicUser' service option. That causes failure during the start of a unit that uses 'DynamicUser'.

Version-Release number of selected component (if applicable):
systemd: 239-1
selinux-policy: 3.14.2-25

How reproducible:
Every time.

Steps to Reproduce:
1. Enable unit with configured 'DynamicUser' - systemd-networkd in my case.

Actual results:
Unit fails to start.

Expected results:
Unit starts correctly.

Additional info:
Used workaraund:
# ausearch -c '(networkd)' --raw|audit2allow -M init-passwd
# semodule -X 300 -i init-passwd.pp

# cat init-passwd.te 

module init-passwd 1.0;

require {
	type init_t;
	type passwd_file_t;
	class file write;
}

#============= init_t ==============
allow init_t passwd_file_t:file write;

Comment 1 Lukas Vrabec 2018-07-03 08:52:05 UTC

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