[ 
https://issues.apache.org/jira/browse/SLING-10145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bertrand Delacretaz updated SLING-10145:
----------------------------------------
    Description: 
While applying the SLING-9090 patch I mistakenly changed
{code:java}
} else if (action == AclLine.Action.REMOVE_ALL) {
  if (removePrincipalEntries(acl, principalName, getJcrPaths(session, 
line.getProperty(PROP_PATHS)))) {
    modified = true;
}
{code}
To
{code:java}
} 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:java}
} 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.

_Update_

  was:
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.



> No removes happen with duplicated "remove *" repoinit statement
> ---------------------------------------------------------------
>
>                 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:java}
> } else if (action == AclLine.Action.REMOVE_ALL) {
>   if (removePrincipalEntries(acl, principalName, getJcrPaths(session, 
> line.getProperty(PROP_PATHS)))) {
>     modified = true;
> }
> {code}
> To
> {code:java}
> } 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:java}
> } 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.
> _Update_



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to