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

neil_a_wilson
31.14.2006 a47a0833bea1b6862881f42624c67c8be3525ed7
Update the modify operation to fix two problems:

- When the "force change on add" or "force change on reset" was enabled in the
password policy and the user's password had been administratively reset, it
was still possible for that user to perform modify operations against entries
other than their own. Issue #904.

- When the "force change on add" feature was enabled but "force change on
reset" was not, the server would not clear the reset flag when a user changed
his or her password via a modify operation. Issue #905.
1 files modified
22 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperation.java 22 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperation.java
@@ -836,6 +836,25 @@
      }
      // If the user must change their password before doing anything else, and
      // if the target of the modify operation isn't the user's own entry, then
      // reject the request.
      if (clientConnection.mustChangePassword())
      {
        DN authzDN = getAuthorizationDN();
        if ((authzDN != null) && (! authzDN.equals(entryDN)))
        {
          // The user will not be allowed to do anything else before
          // the password gets changed.
          setResultCode(ResultCode.UNWILLING_TO_PERFORM);
          int msgID = MSGID_MODIFY_MUST_CHANGE_PASSWORD;
          appendErrorMessage(getMessage(msgID));
          break modifyProcessing;
        }
      }
      // Check for and handle a request to cancel this operation.
      if (cancelRequest != null)
      {
@@ -1283,7 +1302,8 @@
            pwPolicyState.clearGraceLoginTimes();
            pwPolicyState.clearWarnedTime();
            if (pwPolicyState.forceChangeOnReset())
            if (pwPolicyState.forceChangeOnAdd() ||
                pwPolicyState.forceChangeOnReset())
            {
              pwPolicyState.setMustChangePassword(! selfChange);
            }