On 3/29/22 09:24, Gregory Sloop via samba wrote:> > >> Hi Ralph - > >> On 3/29/22 03:24, Ralph Boehme wrote: > >>> On 3/28/22 22:36, Patrick Goetz via samba wrote: > >>>> So my plan is to transfer the data to the new server and then run a >> script that recurses through the filesystem, changing user and group >> ownership. I think the basic unix permissions are respected (sort of), >> but this means I can't attempt to use POSIX ACLs to simplify their >> permissions setup, because these won't be recognized on Windows, where >> they do a lot of their work.? Having a command to set Windows ACLs >> from POSIX ACLs would be handy in this case. >>>> iirc Bj?rn is working on such a feature for samba-tool. >>>> But it also looks like Jeremy and you talk past each other. >>>> We *do* store a hash of the underyling permissions, including POSIX ACL, > in our xattr. We *do* check whether the underyling permissions have > changed by hasing the current permissions and comparing against the > stored hash. We *do* discard the stored NT ACL in case both don't match > and go back to building a new NT ACL based on the underlying permissions. >>>> Does that clarify things? Or evantually I missed something in the > discussion that I didn't follow closely from the start, just chiming in. :) > >> Yes, this clarifies things considerably and makes a lot more sense. > >> My nightmare use case is an archivist group with very deeply nested directory structures, where, for some subdirectories uploaded by an external user prior to the machine being bound to the Samba AD, the users are unable to edit files even though the linux permissions look fine. I tried resetting permissions from Windows, but that just crashes, and I can't even see what the Windows permissions are for these deep subdirectories, because the Security tab is missing from Properties, likely because File Explorer doesn't support long paths. ?There's probably some way to do this with Powershell. > >> Your comment suggests that I might be able to fix this by recursively resetting all the POSIX ACLs on linux for the entire filesystem, which would be great. If that fails, I'll have to develop some more Powershell expertise. > > 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> > (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
Greg Sloop <gregs@sloop.net>
2022-Mar-29 16:08 UTC
[Samba] Remove all Windows ACL's from files/folders
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 = 0Yes, I do have this.>If you have to set acl_xattr:ignore system acls = yes in order to editprivileges 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. -Greg> > > > > > (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 >