Bug 973231 - SELinux is preventing /usr/sbin/smbd from 'rmdir' accesses on the directory 1.
Summary: SELinux is preventing /usr/sbin/smbd from 'rmdir' accesses on the directory 1.
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 18
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:5e4d0b5ac67f366fbd1eda15d9c...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-11 13:55 UTC by Vladimir
Modified: 2013-06-12 14:45 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-12 14:45:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Vladimir 2013-06-11 13:55:31 UTC
Description of problem:
Access on samba shared Folder. 
SE is denying the access 
SELinux is preventing /usr/sbin/smbd from 'rmdir' accesses on the directory 1.

*****  Plugin samba_share (70.3 confidence) suggests  ************************

If you want to allow smbd to have rmdir access on the 1 directory
Then you need to change the label on '1'
Do
# semanage fcontext -a -t samba_share_t '1'
# restorecon  -v '1'

*****  Plugin file (11.4 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin file (11.4 confidence) suggests  *******************************

If you think this is caused by a badly mislabeled machine.
Then you need to fully relabel.
Do
touch /.autorelabel; reboot

*****  Plugin catchall_labels (7.34 confidence) suggests  ********************

If you want to allow smbd to have rmdir access on the 1 directory
Then you need to change the label on 1
Do
# semanage fcontext -a -t FILE_TYPE '1'
where FILE_TYPE is one of the following: auth_cache_t, samba_log_t, samba_share_t, samba_var_t, smbd_tmp_t, smbd_var_run_t. 
Then execute: 
restorecon -v '1'


*****  Plugin catchall (1.86 confidence) suggests  ***************************

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

Additional Information:
Source Context                system_u:system_r:smbd_t:s0
Target Context                system_u:object_r:file_t:s0
Target Objects                1 [ dir ]
Source                        smbd
Source Path                   /usr/sbin/smbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           samba-4.0.6-2.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     (removed)
Platform                      Linux (removed) #localhost.localdomain
                              3.9.4-200.fc18.x86_64 #1 SMP Fri May 24 20:10:49
                              UTC 2013 x86_64 x86_64
Alert Count                   20
First Seen                    2013-06-05 10:30:52 EDT
Last Seen                     2013-06-11 09:45:56 EDT
Local ID                      47dea5aa-a1f0-4542-b025-dcb0f2540a78

Raw Audit Messages
type=AVC msg=audit(1370958356.471:1004): avc:  denied  { rmdir } for  pid=2701 comm="smbd" name="1" dev="sdb1" ino=36700329 scontext=system_u:system_r:smbd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir


type=SYSCALL msg=audit(1370958356.471:1004): arch=x86_64 syscall=rmdir success=yes exit=0 a0=2122150 a1=2122150 a2=2e25027b a3=1 items=0 ppid=1441 pid=2701 auid=4294967295 uid=1000 gid=0 euid=1000 suid=0 fsuid=1000 egid=1002 sgid=0 fsgid=1002 ses=4294967295 tty=(none) comm=smbd exe=/usr/sbin/smbd subj=system_u:system_r:smbd_t:s0 key=(null)

Hash: smbd,smbd_t,file_t,dir,rmdir

audit2allow

#============= smbd_t ==============
allow smbd_t file_t:dir rmdir;

audit2allow -R
require {
	type smbd_t;
}

#============= smbd_t ==============
files_delete_isid_type_dirs(smbd_t)


Additional info:
reporter:       libreport-2.1.4
hashmarkername: setroubleshoot
kernel:         3.9.4-200.fc18.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-06-12 14:45:39 UTC
You need to run restorecon to fix labeling.

# restorecon -R -v PATH_TO_SHARE_FOLDER


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