Bug 866761 - SELinux is preventing /usr/sbin/smbd from 'getattr' accesses on the file /var/public/test.file.
SELinux is preventing /usr/sbin/smbd from 'getattr' accesses on the file /var...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
i686 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-10-16 00:53 EDT by Raj Upadhyaya
Modified: 2012-10-16 12:10 EDT (History)
3 users (show)

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

Attachments (Terms of Use)
File: type (9 bytes, text/plain)
2012-10-16 00:53 EDT, Raj Upadhyaya
no flags Details
File: hashmarkername (14 bytes, text/plain)
2012-10-16 00:53 EDT, Raj Upadhyaya
no flags Details

  None (edit)
Description Raj Upadhyaya 2012-10-16 00:53:51 EDT
Description of problem:
I am trying to configure SAMBA on Fedora 17.  I have created this in the smb.conf
        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 00:53:53 EDT
Created attachment 627949 [details]
File: type
Comment 2 Raj Upadhyaya 2012-10-16 00:53:54 EDT
Created attachment 627950 [details]
File: hashmarkername
Comment 3 Raj Upadhyaya 2012-10-16 01:03:49 EDT
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 08:13:37 EDT
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 08:55:48 EDT
# 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 10:35:56 EDT
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 12:09:54 EDT
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.

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