Bug 1121836 - SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /etc/passwd-.
Summary: SELinux is preventing /usr/sbin/useradd from 'write' accesses on the file /et...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 21
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:b59ad8cc0a4ff91fdc796acf739...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-22 03:32 UTC by abyss.7
Modified: 2014-07-31 14:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-07-31 14:38:32 UTC


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.