[Samba] Remove all Windows ACL's from files/folders

Greg Sloop <gregs@sloop.net> gregs at sloop.net
Tue Mar 29 16:08:11 UTC 2022

On Tue, Mar 29, 2022 at 8:17 AM Patrick Goetz via samba <
samba at lists.samba.org> wrote:

> -SNIP-
> >
> > In all the testing I've done, setting the POSIX perms (via
> setfacl/chown/chmod) doesn't do anything to reset or modify the "Windows"
> ACL listing.
> > -This probably is because I have: acl_xattr:ignore system acls = yes
> (But I only have this set so I can tweak permissions from Windows at all!
> Without it, any permissions mods fail as though I don't have the correct
> privs, even though I'm doing them as Administrator.)
> Just one comment on this for now, as I'm in the middle of a time
> sensitive deployment:
> I use the same [global] defaults for all shares:
>     vfs objects = acl_xattr
>     map acl inherit = yes
>     store dos attributes = yes  # (Yes, I know this is now the default)
> and generally have no problems changing permissions from Windows; either
> as administrator or (I need to double check this) as any other user with
> Full Privileges.  If you have to set acl_xattr:ignore system acls = yes
> in order to edit privileges from Windows, I suspect something else must
> be wrong.
> Have you tried adding this to the [global] section of /etc/samba/smb.conf?
>     min domain uid = 0

>min domain uid = 0
Yes, I do have this.

>If you have to set acl_xattr:ignore system acls = yes in order to edit
privileges from Windows, I suspect something else must be wrong.

And yes, several people have noted that it's "odd" for "acl_xattr:ignore
system acls = yes" to be the only way to edit Windows perms from an admin
level equiv - but Rowland noticed something similar that he thought was a
bug, and my testing seems to also show something very similar to what he
experienced. (But the couple of threads I've posted since hasn't provoked
any direct response from RP or Louis that really addresses any of this. Not
that I'm upset about that, but just that the two best people on the
list, in practical terms, to answer these questions, IMO, haven't really
weighed in. :)

But I need to do one final set of tests - and part of the need to be sure
the Windows ACL's were fully reset was to be sure that some odd "stuck" ACL
wasn't part of the problem. (I don't think that's the case, but I've been
banging my head against the wall trying to ensure that the Windows ACL's
were fully reset before doing more testing, since unless I started clean,
it was impossible to interpret any results in any meaningful way. I think
I've got that now, so we'll see.)

So, yes, I don't think acl_xattr:ignore system acls = yes *should* be
required, but every time I've tinkered, I can't do anything without it
being set.

I'll report back shortly with the what I find with a clean slate of ACL's
to start with.


> >
> > (And tweaking acl_xattr:default acl style = Windows/posix didn't make
> any difference either.)
> >
> > With a few new ideas and some re-reading of the docs, I tried the
> following and it DOES remove the Windows ACL's.
> >
> > cd into the directory you want to mod.
> > setfattr -x security.NTACL ./
> >
> > But there's no "recursive" switch for setfattr, so there's no easy way
> to force it to process all files and directories. You can only remove a
> single ACL at a time. I suppose you might be able to craft something with
> find, but if you've got a large tree, it's not going to be speedy, and I
> suspect it's going to generate a ton of IO.
> >
> > But since I really only want to mod the "root" share folder and then
> fully reset the permissions and then push them down to all child objects,
> this may well work for my situation.
> >
> > And when I do this the permission changes are immediately visible in
> Windows file explorer.
> >
> > Someone should clearly document this in the Wiki.
> > (I suppose if I get enough energy I could do it, but this has been a
> pretty frustrating journey, so motivation is in short supply.)
> >
> > -Greg
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba

More information about the samba mailing list