[Samba] chmod and unix extensions

B Linky blinky203 at gmail.com
Tue Jul 20 12:57:26 GMT 2004


Dear all,

Im trying to set up Samba so that linux users can use the new unix
extensions to be able to chmod their files as they wish. However I
seem to be having problems with masks.

Whether using smbfs or smbclient trying to do: chmod 777 testfile
results only in read permissions for group and other (ie it ends up
744). Under smbfs it complains:

  chmod: changing permissions of `testfile' (requested: 0777, actual:
0744): Operation not permitted

The only way I can it to work is to set "create mask = 0777" in the
server's smb.conf. Now, this is confusing me as the file isnt being
created, I'm just trying to chmod an existing file. I dont want to
leave the setting as this because of course all new files get created
with world read-write which is not what I want.

Looking at the unix_perms_from_wire() function, it would seem it is
indeed applying the create mask.

As an aside, changing permissions from a W2K ACL dialogue seems to work fine.

Any ideas anyone?

Samba version: 3.0.4

Some relevant settings from smb.conf:

# testparm -v | egrep '(force|security|mask|unix extensions)'
Load smb config files from /usr/local/samba/samba-3.0.4/lib/smb.conf
Processing section "[homes]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

        security = USER
        unix extensions = Yes
        paranoid server security = Yes
        force user = 
        force group = 
        create mask = 0744
        force create mode = 00
        security mask = 0777
        force security mode = 00
        directory mask = 0755
        force directory mode = 00
        directory security mask = 0777
        force directory security mode = 00

debug log file gives:
[2004/07/20 13:10:44, 10, pid=24949, effective(6923, 18), real(0, 0)]
smbd/trans2.c:call_trans2setfilepathinfo(3392)
  call_trans2setfilepathinfo: SMB_SET_FILE_UNIX_BASIC: name = testfile
size = 39, uid = 4294967295, gid = 4294967295, raw perms = 0100777
[2004/07/20 13:10:44, 10, pid=24949, effective(6923, 18), real(0, 0)]
smbd/trans2.c:call_trans2setfilepathinfo(3454)
  call_trans2setfilepathinfo: SMB_SET_FILE_UNIX_BASIC setting mode
0744 for file testfile


More information about the samba mailing list