[Samba] Wrong perms on new files/dirs using `mount -t cifs`

Michael Heydon michaelh at jaswin.com.au
Fri Feb 15 02:22:59 GMT 2008


Michael Lueck wrote:
> My original thread had the incorrect subject line. The original 
> trouble / question remains open and unsolved.
>
There are a few things going on here....

> Greetings-
>
> I am working through coming up with a Linux client integration to 
> Samba PDC's.
>
> I mount several shares with this sort of syntax:
> /bin/mount -t cifs -o 
> credentials=/home/userid/.smbcredentials,uid=userid,gid=userid,dmask=0777,fmask=0666 
> //ldslnx01/data /mnt/ldslnx01/data/
>
> However when I create new files/dirs on the Samba share from the Linux 
> workstation, the perms are not 0666/0777 as I have specified.
The dmask/fmask parameters specify the permissions that the client will 
show as being set on remote files. This is based on the assumption that 
the remote server is not compatible with unix style permissions and/or 
has no way of communicating them to the client. When connecting to a 
samba server via cifs, these assumptions do not hold.

The dmask/fmask settings have no bearing on the permissions that the 
server will set on the files, it is purely related to what processes on 
the client system will see.

Aside from all of that, mount.cifs doesn't use *mask any more it uses 
*_mode.
>
> Historically I set those perms on the share, and that has always 
> worked with Windows clients.
>
Windows does not use unix style permissions, it has no equivilant to the 
fmask/dmask settings.
> I added that bit to the mount command, but it made no difference.
>
> I believe I end up with 0755/0644, but do not hold me to that as I 
> have simply verified it is not correct and that is all the checking I 
> have done.
>
This is about what I would expect, you have two unix servers talking via 
cifs, unix extensions will be enabled automatically and file permissions 
on the client will be the same as on the server. If you want to change 
this, you can still use force * mode settings on the server, or you can 
disable unix extensions and use the *_mode options to mount.cifs to 
mimick the old behavior.

> Thanks!
>


*Michael Heydon - IT Administrator *
michaelh at jaswin.com.au <mailto:michaelh at jaswin.com.au>



More information about the samba mailing list