Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-1962 Fix and Improve Locking
  3. OAK-2149

Locks are not enforced for content changes

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.0.19, 1.2.4, 1.3.4
    • None
    • jcr
    • None

    Description

      Locks are not enforced and do not prevent nodes from being modified by non-lock-owning sessions.

      Consider following code excerpt:

      Repository repo = ...
      String path = "/some/node";
      
      Session session1 = repo.login(new SimpleCredentials("A", "password".toCharArray()));
      session1.getNode(path).addMixin("mix:lockable");
      session1.save();
      LockManager lockManager = session1.getWorkspace().getLockManager();
      lockManager.lock(path, true, false, Long.MAX_VALUE, null);
      
      Session session2 = repo.login(new SimpleCredentials("B", "password".toCharArray()));
      session2.getNode(path).setProperty("foo", "bar");
      session2.save();
      

      User A puts a lock on /some/node. User B is still able to set a property on that node after it has been locked. Instead, this should throw a LockException.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              obrist Damien Obrist
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: