Bug 2009 - directory / create mode is not honored
directory / create mode is not honored
Product: CifsVFS
Classification: Unclassified
Component: user space tools
All Linux
: P3 normal
: ---
Assigned To: Steve French
Depends on:
  Show dependency treegraph
Reported: 2004-11-09 19:05 UTC by Clemens Schwaighofer
Modified: 2009-06-22 08:36 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Clemens Schwaighofer 2004-11-09 19:05:43 UTC
I have a samba share where directory mode is set to 0777 and create mode is set
to 0666.

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 file
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.
Comment 1 Steve French 2005-04-02 22:53:46 UTC
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).
Comment 2 Steve French 2005-04-02 22:56:55 UTC
The comments above applied to the wrong defect (bugzilla got confused about
which defect to display as I was typing).
Comment 3 Clemens Schwaighofer 2005-04-20 21:58:35 UTC
I just want to ammend:, 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.
Comment 4 Steve French 2005-08-31 10:46:12 UTC
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.

Comment 5 Shirish S. Pargaonkar 2009-03-26 14:23:09 UTC
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?
Comment 6 Shirish S. Pargaonkar 2009-03-26 15:00:13 UTC
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
Comment 7 Shirish S. Pargaonkar 2009-03-26 20:50:03 UTC
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
of -r--------

So I think things are working as they should.  I think this is not a bug 
Comment 8 Jeff Layton 2009-06-22 08:36:50 UTC
Now that CIFS uses posix creates, this ought to be working as expected. Closing bug based on Shirish's last comment.