Update the server processing for the LDAP no-op control so that it uses a
nonzero result code. For now, we're using a result code of 16654 (0x410e,
which is what OpenLDAP uses). If a new specification is released with an
official OID and result code, then we'll use them.
OpenDS Issue Number: 577
| | |
| | | { |
| | | appendErrorMessage(getMessage(MSGID_MODDN_NOOP)); |
| | | |
| | | // FIXME -- We must set a result code other than SUCCESS. |
| | | setResultCode(ResultCode.NO_OPERATION); |
| | | } |
| | | else |
| | | { |
| | |
| | | responseControls.add(responseControl); |
| | | } |
| | | |
| | | |
| | | if (! noOp) |
| | | { |
| | | setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | { |
| | | operation.appendErrorMessage(getMessage(MSGID_EXTOP_PASSMOD_NOOP)); |
| | | |
| | | // FIXME -- We must set a result code other than SUCCESS. |
| | | operation.setResultCode(ResultCode.SUCCESS); |
| | | operation.setResultCode(ResultCode.NO_OPERATION); |
| | | } |
| | | else |
| | | { |
| | |
| | | CATEGORY_MASK_CORE | SEVERITY_MASK_NOTICE | 619; |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if a workflow is |
| | | * configured with no root workflow element. No root workflow element |
| | | * means no processing on the DIT attached to the workflow, which makes |
| | | * no sense. |
| | | */ |
| | | public static final int MSGID_WARNING_ROOT_WORKFLOW_ELEMENT_NOT_DEFINED = |
| | | CATEGORY_MASK_CORE | SEVERITY_MASK_SEVERE_WARNING | 620; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the message that will be used if an attribute used an |
| | |
| | | |
| | | |
| | | /** |
| | | * The message ID for the string representation of the result code that will |
| | | * be used to indicate no action was taken as a result of the LDAP no-op |
| | | * control. This does not take any arguments. |
| | | */ |
| | | public static final int MSGID_RESULT_NO_OPERATION = |
| | | CATEGORY_MASK_CORE | SEVERITY_MASK_INFORMATIONAL | 624; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Associates a set of generic messages with the message IDs defined |
| | | * in this class. |
| | | */ |
| | |
| | | registerMessage(MSGID_RESULT_CANNOT_CANCEL, "Cannot Cancel"); |
| | | registerMessage(MSGID_RESULT_ASSERTION_FAILED, "Assertion Failed"); |
| | | registerMessage(MSGID_RESULT_AUTHORIZATION_DENIED, "Authorization Denied"); |
| | | registerMessage(MSGID_RESULT_NO_OPERATION, "No Operation"); |
| | | |
| | | |
| | | registerMessage(MSGID_UNKNOWN_ATTRIBUTE_USAGE, |
| | |
| | | "The Directory Server is leaving lockdown mode and will " + |
| | | "resume normal operation"); |
| | | |
| | | registerMessage(MSGID_WARNING_ROOT_WORKFLOW_ELEMENT_NOT_DEFINED, |
| | | "The workflow with base DN \"%s\" has no root workflow " + |
| | | "element" |
| | | ); |
| | | |
| | | |
| | | registerMessage(MSGID_COMPRESSEDSCHEMA_UNRECOGNIZED_AD_TOKEN, |
| | | "Unable to decode the provided attribute because it " + |
| | |
| | | registerMessage(MSGID_ENTRYENCODECFG_INVALID_LENGTH, |
| | | "Unable to decode the provided entry encode " + |
| | | "configuration element because it has an invalid length"); |
| | | |
| | | registerMessage(MSGID_WARNING_ROOT_WORKFLOW_ELEMENT_NOT_DEFINED, |
| | | "The workflow with base DN \"%s\" has no root workflow " + |
| | | "element"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * The LDAP result code for operations in which no action is taken because the |
| | | * request include the LDAP no-op control. |
| | | * |
| | | * FIXME -- This is a temporary result code for use until |
| | | * draft-zeilenga-ldap-noop is updated and an official result code is |
| | | * allocated for it. In the meantime, this result appears to be the |
| | | * one used by OpenLDAP as per the message at |
| | | * http://www.openldap.org/lists/openldap-devel/200601/msg00143.html |
| | | * (0x410e = 16654). |
| | | */ |
| | | public static final int NO_OPERATION = 16654; |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves a string representation of the provided LDAP result code. |
| | | * |
| | | * @param resultCode The LDAP result code value for which to obtain the |
| | |
| | | case AUTHORIZATION_DENIED: |
| | | msgID = MSGID_RESULT_AUTHORIZATION_DENIED; |
| | | break; |
| | | case NO_OPERATION: |
| | | msgID = MSGID_RESULT_NO_OPERATION; |
| | | break; |
| | | default: |
| | | msgID = MSGID_RESULT_OTHER; |
| | | break; |
| | |
| | | * the client to use the requested authorization. |
| | | */ |
| | | AUTHORIZATION_DENIED(LDAPResultCode.AUTHORIZATION_DENIED, |
| | | MSGID_RESULT_AUTHORIZATION_DENIED); |
| | | MSGID_RESULT_AUTHORIZATION_DENIED), |
| | | |
| | | |
| | | |
| | | /** |
| | | * The result code that should be used if the server did not |
| | | * actually complete processing on the associated operation because |
| | | * the request included the LDAP No-Op control. |
| | | */ |
| | | NO_OPERATION(LDAPResultCode.NO_OPERATION, |
| | | MSGID_RESULT_NO_OPERATION); |
| | | |
| | | |
| | | |
| | |
| | | return ASSERTION_FAILED; |
| | | case LDAPResultCode.AUTHORIZATION_DENIED: |
| | | return AUTHORIZATION_DENIED; |
| | | case LDAPResultCode.NO_OPERATION: |
| | | // FIXME -- We will also need to handle the official result |
| | | // code when it is allocated. |
| | | return NO_OPERATION; |
| | | default: |
| | | return ResultCode.OTHER; |
| | | } |
| | |
| | | { |
| | | localOp.appendErrorMessage(getMessage(MSGID_MODIFY_NOOP)); |
| | | |
| | | // FIXME -- We must set a result code other than SUCCESS. |
| | | localOp.setResultCode(ResultCode.NO_OPERATION); |
| | | } |
| | | else |
| | | { |
| | |
| | | localOp.getResponseControls().add(responseControl); |
| | | } |
| | | |
| | | if (! noOp) |
| | | { |
| | | localOp.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | { |
| | | localOp.appendErrorMessage(getMessage(MSGID_ADD_NOOP)); |
| | | |
| | | // FIXME -- We must set a result code other than SUCCESS. |
| | | localOp.setResultCode(ResultCode.NO_OPERATION); |
| | | } |
| | | else |
| | | { |
| | |
| | | localOp.addResponseControl(responseControl); |
| | | } |
| | | |
| | | |
| | | if (! noOp) |
| | | { |
| | | localOp.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | { |
| | | localOp.appendErrorMessage(getMessage(MSGID_DELETE_NOOP)); |
| | | |
| | | // FIXME -- We must set a result code other than SUCCESS. |
| | | localOp.setResultCode(ResultCode.NO_OPERATION); |
| | | } |
| | | else |
| | | { |
| | |
| | | localOp.addResponseControl(responseControl); |
| | | } |
| | | |
| | | |
| | | if (! noOp) |
| | | { |
| | | localOp.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | } |
| | | catch (DirectoryException de) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | import org.opends.server.core.AddOperation; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.OperatingSystem; |
| | | import org.opends.server.types.ResultCode; |
| | |
| | | "o=test" |
| | | }; |
| | | |
| | | assertEquals(LDAPDelete.mainDelete(args, false, null, System.err), 0); |
| | | assertEquals(LDAPDelete.mainDelete(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "o=test" |
| | | }; |
| | | |
| | | assertEquals(LDAPDelete.mainDelete(args, false, null, System.err), 0); |
| | | assertEquals(LDAPDelete.mainDelete(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | import org.opends.server.core.AddOperation; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | |
| | | "-f", modifyFilePath |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", modifyFilePath |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-f", path |
| | | }; |
| | | |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), 0); |
| | | assertEquals(LDAPModify.mainModify(args, false, null, System.err), |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | import org.opends.server.core.AddOperation; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.protocols.internal.InternalClientConnection; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.ResultCode; |
| | | |
| | |
| | | * @throws Exception If an unexpected problem occurs. |
| | | */ |
| | | @Test() |
| | | public void testLDAPNoOpUnsupportedCriticalControl() |
| | | public void testUnsupportedCriticalControl() |
| | | throws Exception |
| | | { |
| | | TestCaseUtils.initializeTestBackend(true); |
| | |
| | | "-J", OID_LDAP_NOOP_OPENLDAP_ASSIGNED + ":true" |
| | | }; |
| | | |
| | | // FIXME -- Change this whenever the real LDAP No-Op result code is assigned |
| | | assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null), |
| | | 0); |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-J", "noop:true" |
| | | }; |
| | | |
| | | // FIXME -- Change this whenever the real LDAP No-Op result code is assigned |
| | | assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null), |
| | | 0); |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |
| | |
| | | "-J", OID_PASSWORD_POLICY_CONTROL + ":true" |
| | | }; |
| | | |
| | | // FIXME -- Change this whenever the real LDAP No-Op result code is assigned |
| | | assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null), |
| | | 0); |
| | | LDAPResultCode.NO_OPERATION); |
| | | } |
| | | |
| | | |