[Samba] Apply destination folder ACLs when moving folders

David PAUGAM David.Paugam at genavir.fr
Wed Jun 16 12:17:04 UTC 2021


Hello Andrew,

thanks for your reply.

I could have an interest in a few small cases. This could be an 
interesting option of Samba if the full mechanism could be OS agnostic, 
which I'm not sure of. Could it be? If not, no matter. I'll deal 
differently, scripting or something else.

David



Le 15/06/2021 à 17:42, Andrew Walker a écrit :
>
>
> On Tue, Jun 15, 2021 at 11:18 AM David PAUGAM via samba <> wrote:
>
>     Hi all,
>
>     sorry if that question has already been asked, but I can't find any
>     clear answer to this...
>
>
>     I would like to move (cut and paste from a Windows station) a full
>     directory with sub-directories and files from one folder in a
>     volume to
>     another folder in the same volume.
>
>     The second folder does not have the same permissions than the
>     first one.
>
>     The expected behaviour is that the moved directory inherits the ACLs
>     from the destination folder. But, instead, it keeps the ACLs of the
>     original folder.
>
>
>     Does anybody know if it is possible to force the moved folder to
>     inherit
>     the permissions from the new hierarchy?
>
>     Thanks in advance for any help.
>
>     David
>
>
>
>     -- 
>     To unsubscribe from this list go to the following URL and read the
>     instructions: https://lists.samba.org/mailman/options/samba
>     <https://lists.samba.org/mailman/options/samba>
>
>
> This is expected behavior for this sort of operation (rename). I 
> believe windows has a configuration option for this "move security 
> attributes", but default behavior is the same as what you see in 
> samba. I've written a VFS module that on rename will calculate an 
> inherited ACL from the destination, and then use fts(3) to walk 
> through the moved tree and re-inherits at each level. ACL operations 
> pass through samba's VFS so should be OS / configuration agnostic, but 
> fts(3) is not so much. I never upstreamed because it won't work 
> with vfs_glusterfs (and probably some other edge cases), but I'm happy 
> to make a merge request against master if there's interest in such a 
> capability.


More information about the samba mailing list