Bug 884911

Summary: SELinux is preventing /usr/sbin/winbindd from 'write' accesses on the directory /var/cache.
Product: [Fedora] Fedora Reporter: Eric Blake <eblake>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:6df87b9fceb29153c82db8270dc83c32a7eb2cacb7e29352a5ee2693b31a9e7e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-18 06:55:24 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 Eric Blake 2012-12-07 02:17:44 UTC
Description of problem:
I typed 'systemctl enable winbind && systemctl start winbind'
SELinux is preventing /usr/sbin/winbindd from 'write' accesses on the directory /var/cache.

*****  Plugin catchall_labels (83.8 confidence) suggests  ********************

If you want to allow winbindd to have write access on the cache directory
Then you need to change the label on /var/cache
Do
# semanage fcontext -a -t FILE_TYPE '/var/cache'
where FILE_TYPE is one of the following: var_log_t, ctdbd_var_lib_t, pcscd_var_run_t, samba_var_t, var_run_t, smbd_var_run_t, samba_etc_t, samba_log_t, user_home_dir_t, winbind_var_run_t, tmp_t, user_tmp_t, auth_cache_t, user_home_t. 
Then execute: 
restorecon -v '/var/cache'


*****  Plugin catchall (17.1 confidence) suggests  ***************************

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

Additional Information:
Source Context                system_u:system_r:winbind_t:s0
Target Context                system_u:object_r:var_t:s0
Target Objects                /var/cache [ dir ]
Source                        winbindd
Source Path                   /usr/sbin/winbindd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           samba-winbind-4.0.0-170.fc18.rc6.x86_64
Target RPM Packages           filesystem-3.1-2.fc18.x86_64
Policy RPM                    selinux-policy-3.11.1-59.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.6.9-4.fc18.x86_64 #1 SMP Tue Dec
                              4 14:12:51 UTC 2012 x86_64 x86_64
Alert Count                   1
First Seen                    2012-12-06 19:14:53 MST
Last Seen                     2012-12-06 19:14:53 MST
Local ID                      ff64531d-5bad-4191-80cc-13b5e68d930f

Raw Audit Messages
type=AVC msg=audit(1354846493.173:435): avc:  denied  { write } for  pid=3625 comm="winbindd" name="cache" dev="dm-2" ino=13 scontext=system_u:system_r:winbind_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=dir


type=SYSCALL msg=audit(1354846493.173:435): arch=x86_64 syscall=mkdir success=no exit=EACCES a0=25ce2a0 a1=1ed a2=0 a3=61 items=0 ppid=1 pid=3625 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=winbindd exe=/usr/sbin/winbindd subj=system_u:system_r:winbind_t:s0 key=(null)

Hash: winbindd,winbind_t,var_t,dir,write

audit2allow

#============= winbind_t ==============
#!!!! The source type 'winbind_t' can write to a 'dir' of the following types:
# var_log_t, ctdbd_var_lib_t, pcscd_var_run_t, samba_var_t, var_run_t, smbd_var_run_t, samba_etc_t, samba_log_t, user_home_dir_t, winbind_var_run_t, tmp_t, user_tmp_t, auth_cache_t, user_home_t

allow winbind_t var_t:dir write;

audit2allow -R

#============= winbind_t ==============
#!!!! The source type 'winbind_t' can write to a 'dir' of the following types:
# var_log_t, ctdbd_var_lib_t, pcscd_var_run_t, samba_var_t, var_run_t, smbd_var_run_t, samba_etc_t, samba_log_t, user_home_dir_t, winbind_var_run_t, tmp_t, user_tmp_t, auth_cache_t, user_home_t

allow winbind_t var_t:dir write;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.6.9-4.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2012-12-07 17:59:18 UTC
Fixed in selinux-policy-3.11.1-61.fc18.noarch

Comment 2 Fedora Update System 2012-12-11 17:52:20 UTC
selinux-policy-3.11.1-62.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-62.fc18

Comment 3 Fedora Update System 2012-12-11 23:29:01 UTC
Package selinux-policy-3.11.1-62.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.11.1-62.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-20203/selinux-policy-3.11.1-62.fc18
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-12-17 17:40:44 UTC
selinux-policy-3.11.1-66.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-66.fc18

Comment 5 Fedora Update System 2012-12-18 06:55:25 UTC
selinux-policy-3.11.1-66.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.