Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3006

UserManager: concurrent user creation using same intermediate path fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.7
    • 2.3
    • security
    • None

    Description

      concurrently creating users using same intermediate path fails with "node ... has been modified externally".

      the problem is the intermediate path. if it doesn't exist multiple threads try to create it concurrently:

      o.a.jackrabbit.core.security.user.UserManagerImpl, line 1310ff:

      String[] segmts = defaultPath.split("/");
      NodeImpl folder = (NodeImpl) session.getRootNode();
      String authRoot = (isGroup) ? groupsPath : usersPath;

      for (String segment : segmts) {
      if (segment.length() < 1)

      { continue; }

      if (folder.hasNode(segment)) {
      folder = (NodeImpl) folder.getNode(segment);
      if (Text.isDescendantOrEqual(authRoot, folder.getPath()) &&
      !folder.isNodeType(NT_REP_AUTHORIZABLE_FOLDER))

      { throw new ConstraintViolationException("Invalid intermediate path. Must be of type rep:AuthorizableFolder."); }

      } else

      { Node parent = folder; folder = addNode(folder, session.getQName(segment), NT_REP_AUTHORIZABLE_FOLDER); }

      }

      the attached test case illustrates this issue/

      Attachments

        1. JCR-3006.patch
          7 kB
          Julian Reschke
        2. JCR-3006.patch
          7 kB
          Julian Reschke
        3. ConcurrentCreateUserTest.java
          3 kB
          Julian Reschke
        4. ConcurrentCreateUserTest.java
          3 kB
          Julian Reschke
        5. ConcurrentCreateUserTest.java
          3 kB
          Stefan Guggisberg

        Activity

          People

            Unassigned Unassigned
            stefan@jira Stefan Guggisberg
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: