Fix for Samba server masking world writeable perm off

Steve French smfrench at gmail.com
Tue Feb 26 06:20:20 UTC 2019


Very strange - I noticed that using jra's experimental POSIX code, the
Samba server would always mask off the world writeable flag ie 0777
would become 0775 permissions.   No matter what the masks were in
smb.conf.

Turned out to be simple but strange:

Removing the
       "obey pam restrictions"
line from smb.conf (which seems to be set by default in some distros)
fixed the problem.   Now a SMB3.1.1 POSIX mkdir ends up with 0777 mode
after a mkdir -m 0777 ...

I am quite surprised that this parm does anything related to the mode
bits, and would not have thought of it, but noticed it when googling
for these particular permissions .... (it hit on this post from a year
ago where a user hit the same problem with permissions being masked
this way and Samba server:
https://askubuntu.com/questions/210808/set-umask-set-permissions-and-set-acl-but-samba-isnt-using-those)
.

Any idea why "obey pam restrictions" would cause Samba to mask mode bits?

You can see below an example of the mode bits for two directories
created back to back with identical command, identical smb request
(one with the smb.conf parm set, one with it not set)

drwxrwxrwx  2 testuser    4096 Feb 26 00:11 0777aftersmbconfupdate
drwxrwxr-x  2 testuser     4096 Feb 26 00:11 0777beforesmbconfupd





-- 
Thanks,

Steve



More information about the samba-technical mailing list