I got a Samba share to which every user is allowed to access and within that share there are directories for each group set on server so it looks like this:

ls -l 
drwsrws--- 11 root p_01 4096 2018-01-17  Share1
drwsrws--- 13 root p_02 4096 2018-01-17  Share2

SUID is set so when user creates new file/directory within that directory it will inherit it's permissions along with owning group. And that works just fine both on local computer and as Samba share (both on Linux and Windows).

The problem is that when user copy a file from Share1 to Share2 it would also copy permissions (with owning group).

When I copy the same file locally on server it would get the permissions from parent directory as desired.

2018-10-15 EDIT: Here's relevant parts of smb.conf:

    passdb backend = tdbsam
    printing = cups                                                                                                                                                            
    printcap name = cups                                                                                                                                                       
    printcap cache time = 750
    cups options = raw
    map to guest = Bad User
    include = /etc/samba/dhcp.conf
    logon path = \\%L\profiles\.msprofile
    logon home = \\%L\%U\.9xprofile
    logon drive = P:
    usershare allow guests = No
    add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
    domain logons = No
    domain master = No
    netbios name = SERVER
    security = user
    wins support = Yes
    workgroup = NORDPRIM

    inherit acls = Yes
    path = /data/NORDPRIM
    read only = No
    inherit permissions = Yes
    force create mode = 774
    create mask = 774
    directory mask = 2775
    force directory mode = 2775
    vfs objects = recycle
  • Copying is from Windows, right? – mrc02_kr Oct 12 '18 at 12:47
  • Both in Windows and Linux – FilipK Oct 12 '18 at 12:50
  • Could you try adding inherit permissions = yes to share's configuration? – mrc02_kr Oct 12 '18 at 13:08
  • I already have that option enabled – FilipK Oct 15 '18 at 8:11
  • Who knows? You haven't posted your smb.conf file here. – mrc02_kr Oct 15 '18 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.