After the issue regarding the ntpd process, I encountered another problem with my D-Link DNS-313. This time it was about permissions problem using Samba.
Because I have multiple user accounts sharing the same data, I added the following lines into the Samba configuration file (smb.conf
):
create mask = 0774 directory mask = 0775 force create mode = 0774 force directory mode = 0775
With these properties, a user will have the permission to read any files created by another user and will also be able to edit them if both users are part of the same group.
However, it appeared that these properties had been ignored by Samba! 🙁 Please note that the client was a Mac OS X 10.6.6 (Snow Leopard) and the Samba version on the NAS was 3.0.25a.
After some googling on the web, I found the following explanation on the contribs.org forum:
Samba 3.0.2x has the ‘unix extensions’ option set to ‘on’ by default. This allows Unix users who write to the Samba shares to set their own permissions bits. Mac OS X up until now has never attempted to do this, but from Leopard, any directory that gets created on a Samba share, get chmod’ed through this Samba extension.
Alright, this is clear enough! This means that we have to set the ‘unix extensions’ option to ‘no’ in our Samba configuration file:
unix extensions = no
The problem should be gone after restarting Samba. 🙂
#1 by Gin Tan on 20 Apr 2011 - 03:08
I have the same problem, did the unix extensions = no
but didn’t work 🙁
#2 by smoreau on 20 Apr 2011 - 08:10
Did you restart Samba after the change?
Please note that I had this particular problem on a DNS-313. Do you have the exact same NAS? If yes, do you have the same version of Samba?
#3 by coolreddy on 31 Jul 2011 - 21:40
Thanks a lot for your solution. It worked great for me. I had the same issue using the default samba versionon CentOS 5.3 elease and Mac OSX 10.6.8 (Snow Leopard client. Windows was honoring the “create mask” and “directory mask”, but Mac OSX was not. Then I added “unix extensions = no” inside the individual shares, but did not help. Then I added this inside the [global] section and it worked like a charm.
#4 by smoreau on 31 Jul 2011 - 23:18
You are very welcome. I am happy to hear that my post helped people. 🙂
Yes, I forgot to mention that the ‘unix extensions’ option needs to be added inside the [global] section.
#5 by allenjd on 18 Oct 2012 - 19:14
Lost most of a day to this. I should have tried the Windows client sooner to see the different behaviour. Thanks for the tip!
#6 by wildpack on 12 Dec 2012 - 15:36
I’ve recently acquired Mac and modified as suggested.
However, note that when copying files from Mac to Samba server and then back from the server, the files/directories permissions won’t be the same as the original. All owner bits are set, and all group and world are gone. Just sayin’.
#7 by IainC on 29 Apr 2014 - 13:03
Cheers, that solved my problem.