SELinux Preventing SMB sharing dafs2 mount

Support for security such as Firewalls and securing linux
Post Reply
Damacles
Posts: 8
Joined: 2005/12/19 15:12:22

SELinux Preventing SMB sharing dafs2 mount

Post by Damacles » 2019/07/22 13:55:12

Hi

I have mounted a davfs share from a nextcloud server into my filesystem and would like to share it RO via SMB
I have it all set up but selinux silently prevents access to the data in the share via smb.
I can enter the share /servername/NextcloudRO but cannot descend into next level
Centos 7 1810
No entries in /var/log/audit/audit.log
No entries in /var/log/samba/log.smbd
Works OK if I "setenforce 0"

Anyone got any ideas ?

Code: Select all

SMB.conf entry
[Nextcloud RO]
  valid users = Doujon
  comment = Read Only Nextcloud Files
  path = /storage/Samba/Nextcloud  	
  read only = yes
  hide files = desktop.ini/$RECYCLE.BIN/lost+found

Code: Select all

ls -laZ /storage/Samba/
drwxr-xr-x. doujon doujon             unconfined_u:object_r:samba_share_t:s0 .
drwxr-xr-x. root root                 unconfined_u:object_r:default_t:s0 ..
drwxr-xr-x. doujon doujon             system_u:object_r:samba_share_t:s0 Documents
drwxr-xr-x. doujon doujon             unconfined_u:object_r:samba_share_t:s0 Logs
drwxr-xr-x. doujon doujon             system_u:object_r:samba_share_t:s0 Masters
drwxr-sr-x. doujon musicserver 	      system_u:object_r:samba_share_t:s0 Music
drwxr-xr-x. doujon doujon             unconfined_u:object_r:samba_share_t:s0 Nextcloud
drwxr-xr-x. doujon doujon             system_u:object_r:samba_share_t:s0 System
drwxrwsr-x. doujon doujon             system_u:object_r:samba_share_t:s0 Videos
drwxrws---. doujon users	      system_u:object_r:samba_share_t:s0 Windowsbackups

Code: Select all

ls -laZ /storage/Samba/Nextcloud/
drwxr-xr-x. doujon doujon unconfined_u:object_r:samba_share_t:s0 .
drwxr-xr-x. doujon doujon unconfined_u:object_r:samba_share_t:s0 ..
drwxr-xr-x. doujon doujon system_u:object_r:fusefs_t:s0    COMPANY
drwxr-xr-x. doujon doujon system_u:object_r:fusefs_t:s0    doujon
Thanks in advance

Dam

Damacles
Posts: 8
Joined: 2005/12/19 15:12:22

Re: SELinux Preventing SMB sharing dafs2 mount

Post by Damacles » 2019/07/22 21:15:31

It turns out that the error wasn't silent !

sealert -a /var/log/audit/audit.log

Gave (one of many) suggestions

setsebool -P samba_share_fusefs 1

Which looked like it fitted the bill and worked !

All good now

Dam

mctesy
Posts: 5
Joined: 2019/07/01 13:31:14

Re: SELinux Preventing SMB sharing dafs2 mount

Post by mctesy » 2019/07/27 18:24:07

Got the same problem and you're solution helped me, didn't know about sealert. Many thanks!

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: SELinux Preventing SMB sharing dafs2 mount

Post by TrevorH » 2019/07/27 18:36:35

For samba/selinux problems, it's also useful to read /etc/samba/smb.conf.example
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply