When modifying ACLs recursively, strip the inheritance flags from each of the ACL entries.
This code was extracted from the patch originally submitted to PR 155163
Differential D15061
Remove NFSv4 inheritance flags in setfacl recursive mode mhorne063_gmail.com on Apr 13 2018, 6:41 PM. Authored by Tags None Referenced Files
Subscribers
Details
When modifying ACLs recursively, strip the inheritance flags from each of the ACL entries. This code was extracted from the patch originally submitted to PR 155163
Diff Detail
Event TimelineComment Actions It has been quite a few years since I originally wrote this code. This might be able to carve out some time these next two weeks to refactor it. There are parts of this patch that feel a bit awkward and could likely be improved upon. Part of me wonders if the inheritance sanitization code should live in libc with the rest of the ACL code. Doing so would allow other projects that deal with ACLs to take advantage of it. Comment Actions Cleaned this up a bit. The logic is the same but should be a bit more obvious now. Unless I missed something there was no reason to be calling acl_dup() like we did in the last iteration of the patch. Also made it more obvious that we were ignoring return values by casting them to void
Comment Actions Ahh I see, I misunderstood the purpose of duplicating the ACL. Much better now. Thanks Mark for being so quick to fix this up and commit. |