MacOS – Controlling File Permissions on a Windows File Share

file-sharingmacospermissionsmb

I'm using a Mac running Mountain Lion (10.8.3) with file sharing enabled to Windows users.

Whenever a Windows user copies a file into the share on the Mac (Windows file sharing), the permissions of the file are 600, meaning that other users of the Mac cannot access the file.

Files copied from Mac clients (using AFP) have 644 permissions, which is perfect.

Is there a way to configure the permissions that are set by Apple's Windows file sharing?

Incidentally, I never had this problem previously with Snow-Leopard.

Best Answer

This is probably related to the "safe save" feature of SMB shares in OS X.

To allow group access enter in Terminal:

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server AclsEnabled -bool YES

Source: OS X Server: When saving files on SMB shares, the permissions might be changed so that only the owner can read or write

Then modify/add an ACLs for the shared folder:

chmod +a "everyone allow list,search,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" <Shared_Folder>

and if additional permissions are necessary for a group

chmod +a "<group_name> allow list,search,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit,<additional_permissions>" <Shared_Folder>

and reboot - I don't know if it's sufficient to simply restart File Sharing in the Server.app.

The ACLs also have to be applied to all already existing subsequent items in the shared folder to make them accessible for network users.