Bug 866761

Summary: SELinux is preventing /usr/sbin/smbd from 'getattr' accesses on the file /var/public/test.file.
Product: [Fedora] Fedora Reporter: Raj Upadhyaya <raj>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:3f2bbada941b2fe09230134bee1dabb824d588da51fc6bb0f12e4579847c0f19
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-16 16:10:08 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:
Attachments:
Description Flags
File: type
none
File: hashmarkername none

Description Raj Upadhyaya 2012-10-16 04:53:51 UTC
Description of problem:
I am trying to configure SAMBA on Fedora 17.  I have created this in the smb.conf
[public]
        comment = My Samba Share
        path = /var/public
        read only = no
;       browseable = yes
        guest ok = yes

and created a directory /var/public and chmod 777 to it.

I then used Nautilus to connect to the Windows Share.  It reports that SELinux has detected a problem.



Additional info:
libreport version: 2.0.14
kernel:         3.6.2

Comment 1 Raj Upadhyaya 2012-10-16 04:53:53 UTC
Created attachment 627949 [details]
File: type

Comment 2 Raj Upadhyaya 2012-10-16 04:53:54 UTC
Created attachment 627950 [details]
File: hashmarkername

Comment 3 Raj Upadhyaya 2012-10-16 05:03:49 UTC
I tried creating an empty document in the samba share, but it fails because it tells me access denied.

 - Raj

Comment 4 Miroslav Grepl 2012-10-16 12:13:37 UTC
Either you will need to setup proper labeling or you will need to turn on a boolean.

What AVC are you getting?

Comment 5 Daniel Walsh 2012-10-16 12:55:48 UTC
# semanage fcontext -a -t samba_share_t "/var/public(/.*)?"
# restorecon -R -v /var/public

Then it will work fine for you.  You have to tell SELinux that this is samba data in this directory.

Comment 6 Raj Upadhyaya 2012-10-16 14:35:56 UTC
Ok, that seems to fix it.  I will need to test with a Windows machine mounting the Linux share, but my guess is that will work as well.  What is creating the file test.file?  Can I delete it?  It is zero length.

- Raj

Comment 7 Daniel Walsh 2012-10-16 16:09:54 UTC
Nothing to do with SELinux.

Miroslav we need some improvement on 

man samba_selinux and man smbd_selinux

samba_share_t needs to be called out more.