Bug 1121836

Summary: SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /etc/passwd-.
Product: [Fedora] Fedora Reporter: abyss.7
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: dominick.grift, dwalsh, lvrabec, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:b59ad8cc0a4ff91fdc796acf739af5e0fb57509c4c25a16800d06d853698ee1b
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-31 14:38:32 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 abyss.7 2014-07-22 03:32:54 UTC
Description of problem:
SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /etc/passwd-.

*****  Plugin restorecon (99.5 confidence) suggests   ************************

If you want to fix the label. 
/etc/passwd- default label should be passwd_file_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/passwd-

*****  Plugin catchall (1.49 confidence) suggests   **************************

If you believe that useradd should be allowed write access on the passwd- 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 useradd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                /etc/passwd- [ file ]
Source                        useradd
Source Path                   /usr/sbin/useradd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           shadow-utils-4.1.5.1-15.fc21.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-65.fc21.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.16.0-0.rc5.git1.1.fc21.x86_64 #1
                              SMP Wed Jul 16 18:48:51 UTC 2014 x86_64 x86_64
Alert Count                   1
First Seen                    2014-07-22 07:29:17 MSK
Last Seen                     2014-07-22 07:29:17 MSK
Local ID                      5fb12395-e077-4c63-acbc-566cd3d79d89

Raw Audit Messages
type=AVC msg=audit(1405999757.551:384): avc:  denied  { write } for  pid=2164 comm="useradd" name="passwd-" dev="vda3" ino=237877 scontext=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmpfs_t:s0 tclass=file permissive=0


type=SYSCALL msg=audit(1405999757.551:384): arch=x86_64 syscall=open success=no exit=EACCES a0=7ffff0b74a60 a1=241 a2=1b6 a3=3a745f656c69665f items=0 ppid=2163 pid=2164 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=1 comm=useradd exe=/usr/sbin/useradd subj=unconfined_u:unconfined_r:useradd_t:s0-s0:c0.c1023 key=(null)

Hash: useradd,useradd_t,tmpfs_t,file,write

Version-Release number of selected component:
selinux-policy-3.13.1-65.fc21.noarch

Additional info:
reporter:       libreport-2.2.3
hashmarkername: setroubleshoot
kernel:         3.16.0-0.rc5.git1.1.fc21.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2014-07-31 14:38:32 UTC
systemd bug which has been fixed.