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

Ludovic Poitou
16.11.2016 74b6b13c3355a8f76dad71fc1f138c50f9be1805
Fix for OPENDJ-3279. Rename misnamed function and make sure we don't increment the failure counts when the account is already locked.
1 files modified
14 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java 14 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
@@ -473,8 +473,7 @@
        if (policy.getLockoutFailureCount() > 0)
        {
          generateAccountStatusNotificationForLockedBindAccount(userEntry,
              pwPolicyState);
          updateFailureCount(userEntry, pwPolicyState);
        }
      }
    }
@@ -684,8 +683,7 @@
        if (saslHandler.isPasswordBased(saslMechanism)
            && pwPolicyState.getAuthenticationPolicy().getLockoutFailureCount() > 0)
        {
          generateAccountStatusNotificationForLockedBindAccount(
              saslAuthUserEntry, pwPolicyState);
          updateFailureCount(saslAuthUserEntry, pwPolicyState);
        }
      }
    }
@@ -693,9 +691,13 @@
    return true;
  }
  private void generateAccountStatusNotificationForLockedBindAccount(
      Entry userEntry, PasswordPolicyState pwPolicyState)
  private void updateFailureCount(Entry userEntry, PasswordPolicyState pwPolicyState)
  {
    if (pwPolicyState.lockedDueToFailures())
    {
      // Account is already locked, nothing to do
      return;
    }
    pwPolicyState.updateAuthFailureTimes();
    if (pwPolicyState.lockedDueToFailures())
    {