You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Bertrand Delacretaz (Jira)" <ji...@apache.org> on 2021/02/16 12:13:00 UTC
[jira] [Resolved] (SLING-10145) Wrong handling of "modified" field
in AclUtil.setPrincipalAcl
[ https://issues.apache.org/jira/browse/SLING-10145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bertrand Delacretaz resolved SLING-10145.
-----------------------------------------
Resolution: Fixed
Fixed in commit 611be91 - I haven't been able to expose the problems in tests, that might be a somewhat obscure case but the fix is obvious.
> Wrong handling of "modified" field in AclUtil.setPrincipalAcl
> -------------------------------------------------------------
>
> Key: SLING-10145
> URL: https://issues.apache.org/jira/browse/SLING-10145
> Project: Sling
> Issue Type: Bug
> Components: Repoinit
> Affects Versions: Repoinit JCR 1.1.32
> Reporter: Bertrand Delacretaz
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Fix For: Repoinit JCR 1.1.34
>
>
> While applying the SLING-9090 patch I mistakenly changed
> {code}
> } else if (action == AclLine.Action.REMOVE_ALL) {
> if (removePrincipalEntries(acl, principalName, getJcrPaths(session, line.getProperty(PROP_PATHS)))) {
> modified = true;
> }
> {code}
> To
> {code}
> } else if (action == AclLine.Action.REMOVE_ALL) {
> modified = removePrincipalEntries(acl, principalName, getJcrPaths(session, line.getProperty(PROP_PATHS)));
> {code}
> which can cause {{modified}} to be reset if {{removePrincipalEntries}} returns false, even if another loop iteration has set it true.
> The code should OR {{modified}} with the result of the function call:
> {code}
> } else if (action == AclLine.Action.REMOVE_ALL) {
> modified |= removePrincipalEntries...
> {code}
> The existing tests have not detected this bug, I'll need to augment them to do so before fixing that bug.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)