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

Matthew Swift
10.34.2012 4dd1e1098aad3b50425081ed33bd8d1f6dfdcc3d
Additional fix for OPENDJ-475: Incorrect behaviour/result code regarding non-critical controls

Prevent ACI handler storing control specific attachments when the control has been rejected.
1 files modified
32 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java 32 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -23,7 +23,7 @@
 *
 *
 *      Copyright 2008-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.server.authorization.dseecompat;
@@ -305,24 +305,28 @@
    if (control.getOID().equals(OID_PROXIED_AUTH_V2)
        || control.getOID().equals(OID_PROXIED_AUTH_V1))
    {
      op.setAttachment(ORIG_AUTH_ENTRY, op.getAuthorizationEntry());
      if (ret)
      {
        op.setAttachment(ORIG_AUTH_ENTRY, op.getAuthorizationEntry());
      }
    }
    else if (control.getOID().equals(OID_GET_EFFECTIVE_RIGHTS))
    {
      GetEffectiveRightsRequestControl getEffectiveRightsControl;
      if (control instanceof LDAPControl)
      if (ret)
      {
        getEffectiveRightsControl =
            GetEffectiveRightsRequestControl.DECODER.decode(control
                .isCritical(), ((LDAPControl) control).getValue());
        GetEffectiveRightsRequestControl getEffectiveRightsControl;
        if (control instanceof LDAPControl)
        {
          getEffectiveRightsControl = GetEffectiveRightsRequestControl.DECODER
              .decode(control.isCritical(), ((LDAPControl) control).getValue());
        }
        else
        {
          getEffectiveRightsControl =
              (GetEffectiveRightsRequestControl) control;
        }
        op.setAttachment(OID_GET_EFFECTIVE_RIGHTS, getEffectiveRightsControl);
      }
      else
      {
        getEffectiveRightsControl =
            (GetEffectiveRightsRequestControl) control;
      }
      op.setAttachment(OID_GET_EFFECTIVE_RIGHTS,
          getEffectiveRightsControl);
    }
    return ret;
  }