The Samba-Bugzilla – Bug 2009
directory / create mode is not honored
Last modified: 2009-06-22 08:36:50 UTC
I have a samba share where directory mode is set to 0777 and create mode is set
If I create a directory insdie, the force user/group works, but the directory is
created with my umask and is therefore 0755, same goes for files.
But if I create a file I get this error message back:
touch: setting times of `file': Permission denied
which is kind of strange, because the parent directory is 777 and therefore it
should be possible to create files there.
This patch should fix the last hole in cifs_close
It will be sent off for 2.6.12, and a patch (or at least replacement files for
fs/cifs directory) will be made available in linux-cifs-client SVN for 2.6.8
kernels within a few days (it will be in version 1.32 of the cifs vfs).
The comments above applied to the wrong defect (bugzilla got confused about
which defect to display as I was typing).
I just want to ammend:
188.8.131.52, cifs still doesn't create dirs and files with the correct right.
I have a share mounted, all files have in the samba conf set: 666, and dir: 777.
But when I create a folder in this share, the folder is 555, and the file is 444.
I would expect that the combination of the two masks (local umask and samba
smb.conf mask) will be the end result (unless you explicitly do chmod in which
case only the samba server smb.conf mask matters) ...
So if 755 local and 666 in Samba's smb.conf, I would exptect the result to be
644 for the file.
If Unix extensions are disabled (see /proc/fs/cifs/LinuxExtensionsEnabled) or
if the server does not support the Unix extensions (old Samba, prior to Samba
3) then the mount parm for file_mode will be considered.
The local umask on the process on the client still detemines the permissions
excpet that the permissoins are capped by the create mode for files and
directory mode for directories.
This is working, definitely in 1.55 of the cifs module.
Do you think it is still a problem?
create mode in the share stanza smb.conf does not seem to matter, file
permissions are determined by umask on the process on the client
create mask option in smb.conf works.
So with umask of 0012 and create mask of 444, the the rw- for user was
capped to r--
And with umask of 0012 and create mask of 400, the created file had permissions
So I think things are working as they should. I think this is not a bug
Now that CIFS uses posix creates, this ought to be working as expected. Closing bug based on Shirish's last comment.