Michael Lueck
2008-Feb-15 01:22 UTC
[Samba] Wrong perms on new files/dirs using `mount -t cifs`
My original thread had the incorrect subject line. The original trouble / question remains open and unsolved. 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. Historically I set those perms on the share, and that has always worked with Windows clients. 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. Thanks! -- Michael Lueck Lueck Data Systems http://www.lueckdatasystems.com/
Michael Heydon
2008-Feb-15 02:23 UTC
[Samba] Wrong perms on new files/dirs using `mount -t cifs`
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@jaswin.com.au <mailto:michaelh@jaswin.com.au>
Michael Lueck
2008-Feb-15 02:46 UTC
[Samba] Re: Wrong perms on new files/dirs using `mount -t cifs`
Michael Heydon wrote:>> 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 understood that defined on the share, that is the way to specify what the permissions on new files/dirs will be, and it certainly seems to work that way when dealing with Windows clients. Thus I assumed that a Linux client would work equally well. However I found out otherwise...> 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.I think I would prefer the "force * mode" method rather than disabling anything at this point. Could you elaborate on what exactly you are suggesting to do? Thanks! -- Michael Lueck Lueck Data Systems http://www.lueckdatasystems.com/
Michael Lueck
2008-Feb-18 16:16 UTC
[Samba] Re: Wrong perms on new files/dirs using `mount -t cifs`
Michael Lueck wrote:> Could you elaborate on what exactly you are suggesting to do?I did some digging since I asked that and discovered the following lines for smb.conf shares: [data] comment = Shared Application Data Files path = /srv/shares/data guest ok = no read only = no create mask = 0666 directory mask = 0777 force create mode = 0666 force directory mode = 0777 The last two lines are the new ones. With these lines in place, I am not able to connect to shares from Windows or Linux clients, so I have commented them out again. Why did that happen with the addition of those lines? Thanks! -- Michael Lueck Lueck Data Systems http://www.lueckdatasystems.com/
Maybe Matching Threads
- Wrong perms on new files/dirs using smbmount
- cifs verses smbfs for Linux clients
- Recent inability to view long filenames stored with scp via samba mount
- Recent inability to view long filenames stored with scp via samba mount
- What file gets corrupted in Samba when perms stop working correctly?