[Samba] Wrong perms on new files/dirs using smbmount - Samba

This is a discussion on [Samba] Wrong perms on new files/dirs using smbmount - Samba ; 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,f mask=0666 //ldslnx01/data /mnt/ldslnx01/data/ However when I create new files/dirs on the ...

+ Reply to Thread
Results 1 to 13 of 13

Thread: [Samba] Wrong perms on new files/dirs using smbmount

  1. [Samba] Wrong perms on new files/dirs using smbmount

    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,f mask=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/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  2. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Michael Lueck wrote:
    > 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,f mask=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!
    >

    I think you'll find that is your default umask (more specifically,
    your umask is 022, i.e., (7-0)(7-2)(7-2)=755)

    It must be overriding. I'm not sure why this would be, though. Could
    it be that '/' is mounted with an explicit permission setting that is
    shadowing your mount settings?

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  3. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Scott Lovenberg wrote:
    > Could
    > it be that '/' is mounted with an explicit permission setting that is
    > shadowing your mount settings?


    I do not think so, but have a look. This share happens to be on the /srv partition.
    /dev/sda1 / xfs defaults 0 1
    /dev/sda9 /srv xfs defaults 0 2

    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  4. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Michael Lueck wrote:
    > Scott Lovenberg wrote:
    >> Could it be that '/' is mounted with an explicit permission setting
    >> that is shadowing your mount settings?

    >
    > I do not think so, but have a look. This share happens to be on the /srv
    > partition.
    > /dev/sda1 / xfs defaults 0 1
    > /dev/sda9 /srv xfs defaults 0 2
    >


    That seems fine.

    What are the samba server side settings(smb.conf) for the share you are
    mounting?


    Do you have inherit permissions set?
    from smb.conf(5) man page:

    inherit permissions (S)
    The permissions on new files and directories are normally
    governed by create mask, directory mask, force
    create mode and force directory mode but the boolean inherit
    permissions parameter overrides this.

    New directories inherit the mode of the parent directory,
    including bits such as setgid.

    New files inherit their read/write bits from the parent
    directory. Their execute bits continue to be
    determined by map archive, map hidden and map system as usual.

    Note that the setuid bit is never set via inheritance (the
    code explicitly prohibits this).

    This can be particularly useful on large systems with many
    users, perhaps several thousand, to allow a
    single [homes] share to be used flexibly by each user.

    Default: inherit permissions = no
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  5. Re: [Samba] Wrong perms on new files/dirs using smbmount

    On Wednesday 13 February 2008, Michael Lueck wrote:
    > I mount several shares with this sort of syntax:
    > /bin/mount -t cifs


    Subject line is misleading: smbmount != cifs.

    --
    Chris
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  6. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Chris Smith wrote:
    > On Wednesday 13 February 2008, Michael Lueck wrote:
    >> I mount several shares with this sort of syntax:
    >> /bin/mount -t cifs

    >
    > Subject line is misleading: smbmount != cifs.


    I get the idea from man smbmount that smbmount is merely a wrapper invoking mount -t cifs.

    Would you expect different results if I were using the smbmount binary instead? If so, I would gladly test that method.

    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  7. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Scott Lovenberg wrote:
    > What are the samba server side settings(smb.conf) for the share you are
    > mounting?


    [data]
    comment = Shared Application Data Files
    path = /srv/shares/data
    guest ok = no
    read only = no
    create mask = 0666
    directory mask = 0777

    > Do you have inherit permissions set?
    > from smb.conf(5) man page:
    > Default: inherit permissions = no


    I set inherit acls = yes once for an ACL aware implementation for a client. Otherwise no specific acl/perm stuff at this time.

    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  8. Re: [Samba] Re: Wrong perms on new files/dirs using smbmount

    On Wednesday 13 February 2008, Michael Lueck wrote:
    > I get the idea from man smbmount that smbmount is merely a wrapper
    > invoking mount -t cifs.


    > Would you expect different results if I were using the smbmount
    > binary instead?


    In the sense that it would invoke the deprecated "mount -t smbfs"
    instead of "mount -t cifs", but I wouldn't recommend it.

    --
    Chris
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  9. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Michael Lueck wrote:
    > Scott Lovenberg wrote:
    >> What are the samba server side settings(smb.conf) for the share you
    >> are mounting?

    >
    > [data]
    > comment = Shared Application Data Files
    > path = /srv/shares/data
    > guest ok = no
    > read only = no
    > create mask = 0666
    > directory mask = 0777
    >
    >> Do you have inherit permissions set?
    >> from smb.conf(5) man page:
    >> Default: inherit permissions = no

    >
    > I set inherit acls = yes once for an ACL aware implementation for a
    > client. Otherwise no specific acl/perm stuff at this time.
    >

    Drats, it looks like you're setup fine. I was hoping it would just be a
    bad configuration. I don't know what else it could be.

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  10. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Chris Smith wrote:
    > In the sense that it would invoke the deprecated "mount -t smbfs"
    > instead of "mount -t cifs", but I wouldn't recommend it.


    Aaahhh, so smbclient from the Samba developers is hard coded to not use current smb protocol code? Confusing!

    So "mount -t cifs" would be the most correct way to make a connection?

    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  11. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Scott Lovenberg wrote:
    > Drats, it looks like you're setup fine. I was hoping it would just be a
    > bad configuration. I don't know what else it could be.


    Thanks for at least checking everything is configured correctly.

    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  12. Re: [Samba] Re: Wrong perms on new files/dirs using smbmount

    On Thursday 14 February 2008, Michael Lueck wrote:
    > Aaahhh, so smbclient from the Samba developers is hard coded to not
    > use current smb protocol code? Confusing!


    Smbclient is new to the conversation, which until now has been about
    smbmount which

    > So "mount -t cifs" would be the most correct way to make a
    > connection?


    It is considered the best way under the vast majority of circumstances
    to mount an smb share. Smbclient is a way to connect (not mount) to an
    smb share in an ftp client like fashion. Both are different and neither
    are using smbmount, which is properly used by "mount -t smbfs",
    although deprecated and not recommended.

    --
    Chris
    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

  13. [Samba] Re: Wrong perms on new files/dirs using smbmount

    Chris Smith wrote:
    > Smbclient is new to the conversation, which until now has been about
    > smbmount which


    My error. Yes, I meant smbmount and not smbclient.

    >> So "mount -t cifs" would be the most correct way to make a
    >> connection?

    >
    > It is considered the best way under the vast majority of circumstances
    > to mount an smb share.


    Very well then, I will stick with my current syntax.


    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

    --
    To unsubscribe from this list go to the following URL and read the
    instructions: https://lists.samba.org/mailman/listinfo/samba

+ Reply to Thread