mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Chris Ridd
04.09.2016 3cce0b71d9e4cd41945769415716b2fb782c63a7
OPENDJ-2659 lazily recompute virtual attributes before updating privileges
1 files modified
12 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/core/AuthenticatedUsers.java 12 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/AuthenticatedUsers.java
@@ -221,22 +221,28 @@
  {
    final Entry oldEntry = op.getCurrentEntry();
    if (op.getResultCode() != ResultCode.SUCCESS || oldEntry == null) {
    if (op.getResultCode() != ResultCode.SUCCESS || oldEntry == null)
    {
      return PostResponse.continueOperationProcessing();
    }
    final Entry newEntry = op.getModifiedEntry();
    // Identify any client connections that may be authenticated
    // or authorized as the user whose entry has been modified
    // and update them with the latest version of the entry.
    // and update them with the latest version of the entry
    // including any virtual attributes.
    lock.writeLock().lock();
    try
    {
      CopyOnWriteArraySet<ClientConnection> connectionSet = userMap.get(oldEntry.getName());
      if (connectionSet != null)
      {
        Entry newEntry = null;
        for (ClientConnection conn : connectionSet)
        {
          if (newEntry == null)
          {
            newEntry = op.getModifiedEntry().duplicate(true);
          }
          conn.updateAuthenticationInfo(oldEntry, newEntry);
        }
      }