[Samba] Copying a file server-side and permissions/ACLs inheritance

Eponymous - the.epon at gmail.com
Sun Sep 20 16:41:34 UTC 2015


Hi,

I have a question regarding permissions on Samba / Linux:

If we take this example:

/mnt/share is available as a share accessible over the network via
Samba 4.0 acting as an AD DC.

In that folder I create another folder via Samba on a Windows PC:

share/test

and stick a file in it (again via Samba):

share/test/test_file.txt

I then set the permissions on the "test" folder using the Windows
security tab and select "replace all child object permissions with
inheritable permissions from parent".

Everything looks good so far.

However, if I were to then copy (using rsync or cp) the entire
/mnt/share/test folder *locally, on the Samba 4.0 AD DC server* into
say /mnt/share/test_backup the permissions seem to get confused.

They are now explicitly defined and are no longer inherited from the
parent and I also get a bunch of new permissions entries for accounts
like: "Everyone, CREATOR OWNER, CREATOR GROUP" etc..

Also permissions that were "Modify" become "Full Control" which is not
what I want.

Now I figured quite reasonably that this is because I didn't copy via
Samba and therefore Samba will have no influence on the files'
permissions.

My question is, is there a way to preserve the permissions entries
when copying locally on the server like this? Short of mounting the
local directory as a CIFS share on the same machine from which they
are served and copying into this directory instead, I can't think of a
way.

I hope someone can help.

Many thanks in advance.



More information about the samba mailing list