8

I have a very basic samba share for a development environment. There is a directory /var/www/ owned by www:www. All subdirectories are also owned by www:www. All users are members of the www group. The entire smb.conf file is the default except for the share definition.

[www]
  path = /usr/share/nginx/www/
  public = yes
  writable = yes
  create mask = 0775

I can see the directory structure from windows, but all directories shown as empty. This config works in FreeBSD perfectly. Any ideas?

After getting to the office, I ran wireshark and on the QUERY_PATH_INFO request, I get back STATUS_OBJECT_NAME_NOT_FOUND, over and over again.

I moved the webroot back to the nginx default of /usr/share/nginx, and this for whatever reason solved the browsing problem, but my user now doesn't have permission to write to the directory. If it isn't one thing it's another.

Peter
  • 123
  • 1
  • 1
  • 7
  • Check your samba log and audit logs. – Michael Hampton Sep 02 '14 at 13:00
  • What are the permission of the files (not the directories)? Also, on CentOS, Apache usually works as user/group `apache`, not `www`. – Sven Sep 02 '14 at 13:00
  • All of the files and directories are owned by www:www, and the logs don't show anything of consequence, a few errors from the windows machine attempting to reload the directory before it was configured, and some errors regarding printers, which are enabled in the default config, but I'm not using. I'm on nginx, but it's configured to run as www, it's a holdover from FreeBSDwhere the default user is www. – Peter Sep 02 '14 at 14:04
  • 2
    Try `setenforce 0` and see if it's SELinux-related. – MadHatter Sep 02 '14 at 14:58
  • That's in /etc/grub.conf, no? – Peter Sep 02 '14 at 16:06

1 Answers1

18

As told above, try first:

# setenforce 0

if the files appear, then it's a SELinux missing context. Enable SELinux again, then add context to folder:

# setenforce 1
# chcon -Rt samba_share_t /usr/share/nginx/www/
Reaces
  • 5,597
  • 4
  • 38
  • 46
Mario
  • 181
  • 1
  • 5
  • 1
    When something strange goes wrong one has to be vigilant about remembering about SELinux. – gak Mar 17 '16 at 00:34