Bug 622484 - SELinux is preventing Samba (/usr/sbin/smbd) "read" access to smbd.pid.
SELinux is preventing Samba (/usr/sbin/smbd) "read" access to smbd.pid.
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2010-08-09 09:50 EDT by Mark
Modified: 2010-11-03 12:08 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-11-03 12:08:28 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mark 2010-08-09 09:50:16 EDT

SELinux is preventing Samba (/usr/sbin/smbd) "read" access to smbd.pid.

Detailed Description:

SELinux denied samba access to smbd.pid. If you want to share this directory
with samba it has to have a file context label of samba_share_t. If you did not
intend to use smbd.pid as a samba repository it could indicate either a bug or
it could signal a intrusion attempt. Please refer to 'man samba_selinux' for
more information on setting up Samba and SELinux.

Allowing Access:

You can alter the file context by executing chcon -R -t samba_share_t 'smbd.pid'
You must also change the default file context files on the system in order to
preserve them even on a full relabel. "semanage fcontext -a -t samba_share_t

Fix Command:

chcon -R -t samba_share_t 'smbd.pid'

Additional Information:

Source Context                system_u:system_r:smbd_t:s0
Target Context                unconfined_u:object_r:var_run_t:s0
Target Objects                smbd.pid [ file ]
Source                        smbd
Source Path                   /usr/sbin/smbd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           samba-3.5.4-62.fc13
Target RPM Packages           
Policy RPM                    selinux-policy-3.7.19-41.fc13
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Plugin Name                   samba_share
Host Name                     (removed)
Platform                      Linux (removed) #1 SMP Fri
                              Jul 23 17:27:40 UTC 2010 i686 i686
Alert Count                   1
First Seen                    Mon 09 Aug 2010 14:47:55 BST
Last Seen                     Mon 09 Aug 2010 14:47:55 BST
Local ID                      15d740e5-f401-4a73-bfa6-d84571bb6cda
Line Numbers                  

Raw Audit Messages            

node=(removed) type=AVC msg=audit(1281361675.378:18579): avc:  denied  { read } for  pid=3740 comm="smbd" name="smbd.pid" dev=sda1 ino=9055 scontext=system_u:system_r:smbd_t:s0 tcontext=unconfined_u:object_r:var_run_t:s0 tclass=file

node=(removed) type=SYSCALL msg=audit(1281361675.378:18579): arch=40000003 syscall=5 success=no exit=-13 a0=b70a1af0 a1=8800 a2=0 a3=b70a0648 items=0 ppid=1 pid=3740 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="smbd" exe="/usr/sbin/smbd" subj=system_u:system_r:smbd_t:s0 key=(null)

Hash String generated from  samba_share,smbd,smbd_t,var_run_t,file,read
audit2allow suggests:

#============= smbd_t ==============
#!!!! This avc can be allowed using one of the these booleans:
#     samba_export_all_ro, samba_export_all_rw

allow smbd_t var_run_t:file read;
Comment 1 Miroslav Grepl 2010-08-10 10:57:12 EDT
How did you start Samba? 

What is your output of the command

# ps -eZ | grep smb
Comment 2 Daniel Walsh 2010-08-11 08:55:40 EDT
restorecon -R -v /var/run should fix the problem.
Comment 3 Miroslav Grepl 2010-11-03 12:08:28 EDT
You shouldn't see this issue anymore. If I am wrong, please reopen the bug.

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