From 7a6f98492aaeacd4e5a795adc71b75edbc1d126a Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 30 Nov 2006 21:50:39 +0000
Subject: [PATCH] Update the extended operation handler API to provide the ability for custom extended operations to handle their own controls.  The password modify extended operation has been updated to support the LDAP no-op control and the password policy control.

---
 opends/src/server/org/opends/server/core/ExtendedOperation.java |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/ExtendedOperation.java b/opends/src/server/org/opends/server/core/ExtendedOperation.java
index 77eb4f7..37a9514 100644
--- a/opends/src/server/org/opends/server/core/ExtendedOperation.java
+++ b/opends/src/server/org/opends/server/core/ExtendedOperation.java
@@ -559,10 +559,30 @@
       }
 
 
-      // Check the set of controls included in the request.  If there are any,
-      // see if any special processing is required.  This should also include
-      // taking care of any synchronization that might be needed.
-      // NYI
+      // Look at the controls included in the request and ensure that all
+      // critical controls are supported by the handler.
+      List<Control> requestControls = getRequestControls();
+      if ((requestControls != null) && (! requestControls.isEmpty()))
+      {
+        for (Control c : requestControls)
+        {
+          if (! c.isCritical())
+          {
+            // The control isn't critical, so we don't care if it's supported
+            // or not.
+          }
+          else if (! handler.supportsControl(c.getOID()))
+          {
+            setResultCode(ResultCode.UNAVAILABLE_CRITICAL_EXTENSION);
+
+            int msgID = MSGID_EXTENDED_UNSUPPORTED_CRITICAL_CONTROL;
+            appendErrorMessage(getMessage(msgID, String.valueOf(requestOID),
+                                          c.getOID()));
+
+            break extendedProcessing;
+          }
+        }
+      }
 
 
       // Check to see if the client has permission to perform the

--
Gitblit v1.10.0