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

Ludovic Poitou
06.36.2015 b03837dac977fbc5d12e5dc5efc785b1d5d1542f
Fix OPENDJ-1844: NPE in AuthenticatedUsers when pre-parse plugin stop processing with Success.
1 files modified
24 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/core/AuthenticatedUsers.java 24 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/AuthenticatedUsers.java
@@ -230,11 +230,12 @@
  @Override
  public PostResponse doPostResponse(PostResponseModifyOperation op)
  {
    if (op.getResultCode() != ResultCode.SUCCESS) {
    final Entry oldEntry = op.getCurrentEntry();
    if (op.getResultCode() != ResultCode.SUCCESS || oldEntry == null) {
      return PostResponse.continueOperationProcessing();
    }
    final Entry oldEntry = op.getCurrentEntry();
    final Entry newEntry = op.getModifiedEntry();
    // Identify any client connections that may be authenticated
    // or authorized as the user whose entry has been modified
@@ -262,14 +263,15 @@
  @Override
  public PostResponse doPostResponse(PostResponseModifyDNOperation op)
  {
    if (op.getResultCode() != ResultCode.SUCCESS) {
    final Entry oldEntry = op.getOriginalEntry();
    final Entry newEntry = op.getUpdatedEntry();
    if (op.getResultCode() != ResultCode.SUCCESS || oldEntry == null || newEntry == null) {
      return PostResponse.continueOperationProcessing();
    }
    Entry oldEntry = op.getOriginalEntry();
    Entry newEntry = op.getUpdatedEntry();
    DN oldDN = oldEntry.getName();
    DN newDN = newEntry.getName();
    final DN oldDN = oldEntry.getName();
    final DN newDN = newEntry.getName();
    // Identify any client connections that may be authenticated
    // or authorized as the user whose entry has been modified
@@ -277,7 +279,7 @@
    lock.writeLock().lock();
    try
    {
      Set<CopyOnWriteArraySet<ClientConnection>> arraySet =
      final Set<CopyOnWriteArraySet<ClientConnection>> arraySet =
        new HashSet<CopyOnWriteArraySet<ClientConnection>>();
      userMap.removeSubtree(oldEntry.getName(), arraySet);
      for (CopyOnWriteArraySet<ClientConnection> connectionSet : arraySet)
@@ -316,8 +318,7 @@
              logger.traceException(e);
            }
          }
          if (newAuthNDN != null && authNDN != null &&
               authNDN.isDescendantOf(oldEntry.getName()))
          if (newAuthNDN != null && authNDN != null && authNDN.isDescendantOf(oldEntry.getName()))
          {
            if (newAuthNSet == null)
            {
@@ -326,8 +327,7 @@
            conn.getAuthenticationInfo().setAuthenticationDN(newAuthNDN);
            newAuthNSet.add(conn);
          }
          if (newAuthZDN != null && authZDN != null &&
               authZDN.isDescendantOf(oldEntry.getName()))
          if (newAuthZDN != null && authZDN != null && authZDN.isDescendantOf(oldEntry.getName()))
          {
            if (newAuthZSet == null)
            {