Bug 737102 - SELinux is preventing /usr/sbin/useradd from read, write access on the file lastlog.
Summary: SELinux is preventing /usr/sbin/useradd from read, write access on the file l...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 16
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:df1e055032a808eda3766b42cc5...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-09-09 16:03 UTC by Mads Kiilerich
Modified: 2011-09-12 19:21 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-09-12 05:51:36 UTC


Attachments (Terms of Use)

Description Mads Kiilerich 2011-09-09 16:03:56 UTC
abrt version: 2.0.5
executable:     /usr/bin/python
hashmarkername: setroubleshoot
kernel:         3.1.0-0.rc4.git0.0.fc16.x86_64
reason:         SELinux is preventing /usr/sbin/useradd from read, write access on the file lastlog.
time:           Fri Sep  9 18:03:38 2011

description:
:SELinux is preventing /usr/sbin/useradd from read, write access on the file lastlog.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that useradd should be allowed read write access on the lastlog 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:system_r:useradd_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:var_log_t:s0
:Target Objects                lastlog [ file ]
:Source                        useradd
:Source Path                   /usr/sbin/useradd
:Port                          <Unknown>
:Host                          (removed)
:Source RPM Packages           shadow-utils-4.1.4.3-7.fc16
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-25.fc16
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Permissive
:Host Name                     (removed)
:Platform                      Linux (removed) 3.1.0-0.rc4.git0.0.fc16.x86_64 #1 SMP
:                              Tue Aug 30 00:00:26 UTC 2011 x86_64 x86_64
:Alert Count                   5
:First Seen                    Fri 09 Sep 2011 01:41:52 PM CEST
:Last Seen                     Fri 09 Sep 2011 03:17:08 PM CEST
:Local ID                      f3be6369-3044-409c-8375-02b097bd694d
:
:Raw Audit Messages
:type=AVC msg=audit(1315574228.933:265): avc:  denied  { read write } for  pid=14692 comm="useradd" name="lastlog" dev=loop0 ino=1571 scontext=unconfined_u:system_r:useradd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file
:
:
:type=AVC msg=audit(1315574228.933:265): avc:  denied  { open } for  pid=14692 comm="useradd" name="lastlog" dev=loop0 ino=1571 scontext=unconfined_u:system_r:useradd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file
:
:
:type=SYSCALL msg=audit(1315574228.933:265): arch=x86_64 syscall=open success=yes exit=EBADF a0=40e8fd a1=2 a2=2 a3=0 items=0 ppid=14686 pid=14692 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=3 comm=useradd exe=/usr/sbin/useradd subj=unconfined_u:system_r:useradd_t:s0-s0:c0.c1023 key=(null)
:
:Hash: useradd,useradd_t,var_log_t,file,read,write
:
:audit2allow
:
:#============= useradd_t ==============
:#!!!! The source type 'useradd_t' can write to a 'file' of the following types:
:# httpd_user_script_exec_type, security_t, puppet_tmp_t, faillog_t, user_home_type, lastlog_t, initrc_var_run_t, pcscd_var_run_t, httpd_user_content_type, mail_spool_t, shadow_t, etc_t
:
:allow useradd_t var_log_t:file { read write open };
:
:audit2allow -R
:
:#============= useradd_t ==============
:#!!!! The source type 'useradd_t' can write to a 'file' of the following types:
:# httpd_user_script_exec_type, security_t, puppet_tmp_t, faillog_t, user_home_type, lastlog_t, initrc_var_run_t, pcscd_var_run_t, httpd_user_content_type, mail_spool_t, shadow_t, etc_t
:
:allow useradd_t var_log_t:file { read write open };
:

Comment 1 Miroslav Grepl 2011-09-12 05:51:36 UTC
/var/log/lastlog is mislabeled. Not sure how you got this mislabeling.

restorecon -R -v /var/log/lastlog

will fix this problem.

Please reopen the bug if this happens again.

Comment 2 Mads Kiilerich 2011-09-12 09:11:39 UTC
This system has been relabeled recently and I haven't changed any file labels manually. I am sure this wrong labelling has been set by previous package updates.

Ok, others will report it too if it is a "real" problem, and it doesn't matter much anyway if it only has been caused by intermediate pre-release policies.

Comment 3 Miroslav Grepl 2011-09-12 10:13:11 UTC
It could be caused by badly installed update.

What does

# matchpathcon /var/log/lastlog

Comment 4 Mads Kiilerich 2011-09-12 10:45:12 UTC
It shows system_u:object_r:lastlog_t:s0 as expected.

I have also relabeled the system and thus removed the last traces of evidence :-(


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