Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-1348

ACE merging not behaving correctly if not using managed principals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.15
    • 0.16
    • security
    • None

    Description

      org.apache.jackrabbit.api.security.JackrabbitAccessControlList#addEntry() does not work correctly, if the given principal is not retrieved from the PrincipalManager.

      Exception:

      Caused by: org.apache.jackrabbit.oak.api.CommitFailedException: OakAccessControl0013: Duplicate ACE found in policy
      	at org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlValidator.accessViolation(AccessControlValidator.java:278)
      	at org.apache.jackrabbit.oak.security.authorization.accesscontrol.AccessControlValidator.checkValidPolicy(AccessControlValidator.java:188)
      

      this used to work in jackrabbit 2.x.

      the problem is probably in org.apache.jackrabbit.oak.security.authorization.accesscontrol.ACL#internalAddEntry where the principals are "equalled" instead of comparing their names.

      note, that adding an ACE with such a principal works, just the merging/overwriting detection doesn't.

      test:

        Principal p1 = new Principal() { getName(){return "foo"}};
        Principal p2 = new Principal() { getName(){return "foo"}};
        acl.addEntry(p1, privileges, true);
        acl.addEntry(p2, privileges, false);
        ...
        save(); // throws
      

      Attachments

        Activity

          People

            angela Angela Schreiber
            tripod Tobias Bocanegra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: