From f73b655466092169abac34833fb628fce1fcdebe Mon Sep 17 00:00:00 2001
From: jcduff <jcduff@localhost>
Date: Thu, 23 Oct 2008 14:04:24 +0000
Subject: [PATCH] The commit will bring the following features :     - An updated version of the underlying database. BDB JE 3.3 is now used.     - Attribute API refactoring providing a better abstraction and offering improved performances.     - A new GUI called the Control-Panel to replace the Status-Panel: the specifications for this       GUI are available on OpenDS Wiki and contains a link to a mockup.        See <https://www.opends.org/wiki/page/ControlPanelUISpecification>.     - Some changes in the replication protocol to implement "Assured Replication Mode". The        specifications are on OpenDS Wiki at <https://www.opends.org/wiki/page/AssuredMode> and section 7       described some of the replication changes required to support this. Assured Replication is not finished,       but the main replication protocol changes to support it are done. As explained by Gilles on an email on       the Dev mailing list (http://markmail.org/message/46rgo3meq3vriy4a), with these changes the newer versions       of OpenDS may not be able to replicate with OpenDS 1.0 instances.     - Support for Service Tags on the platforms where the functionality is available and enabled. Specifications       are published at <https://www.opends.org/wiki/page/OpenDSServiceTagEnabled>. For more information on       Service Tags see <http://wikis.sun.com/display/ServiceTag/Sun+Service+Tag+FAQ>.     - The Admin Connector service. In order to provide agentry of the OpenDS server at any time, a new service       has been added, dedicated to the administration, configuration and monitoring of the server.       An overview of the Admin Connector service and it's use is available on the       OpenDS wiki <https://www.opends.org/wiki/page/ManagingAdministrationTrafficToTheServer>     - Updates to the various command line tools to support the Admin Connector service.     - Some internal re-architecting of the server to put the foundation of future developments such as virtual       directory services. The new NetworkGroups and WorkFlow internal services which have been specified in       <https://www.opends.org/wiki/page/BasicOperationRoutingThroughNetworkGroup> are now implemented.     - Many bug fixes...

---
 opends/src/server/org/opends/server/core/BindOperationBasis.java |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/BindOperationBasis.java b/opends/src/server/org/opends/server/core/BindOperationBasis.java
index 89dc056..874aed7 100644
--- a/opends/src/server/org/opends/server/core/BindOperationBasis.java
+++ b/opends/src/server/org/opends/server/core/BindOperationBasis.java
@@ -29,6 +29,7 @@
 import org.opends.messages.MessageBuilder;
 
 
+import static org.opends.server.config.ConfigConstants.DN_CONFIG_ROOT;
 import static org.opends.server.core.CoreConstants.LOG_ELEMENT_AUTH_TYPE;
 import static org.opends.server.core.CoreConstants.LOG_ELEMENT_BIND_DN;
 import static org.opends.server.core.CoreConstants.LOG_ELEMENT_ERROR_MESSAGE;
@@ -48,6 +49,7 @@
 
 import org.opends.server.api.ClientConnection;
 import org.opends.server.api.plugin.PluginResult;
+import org.opends.server.core.networkgroups.NetworkGroup;
 import org.opends.server.loggers.debug.DebugLogger;
 import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.protocols.asn1.ASN1OctetString;
@@ -790,10 +792,30 @@
       }
 
 
-      // Retrieve the network group attached to the client connection
-      // and get a workflow to process the operation.
-      NetworkGroup ng = getClientConnection().getNetworkGroup();
-      Workflow workflow = ng.getWorkflowCandidate(bindDN);
+      // Special case to manage RootDNs
+      // RootDNs are stored in cn=config but this workflow is not
+      // available through non-admin network groups.
+      // So if the bind DN is in cn=config, we directly retrieve
+      // the workflow handling cn=config
+      // FIXME: it would be better to store RootDNs in a separate backend.
+      // Issue #3502 has been logged to track this request.
+      boolean isInConfig;
+      try {
+        isInConfig = bindDN.isDescendantOf(DN.decode(DN_CONFIG_ROOT));
+      } catch (DirectoryException ex) {
+        // can not happen
+        isInConfig = false;
+      }
+
+      Workflow workflow;
+      if (isInConfig) {
+        workflow = WorkflowImpl.getWorkflow("__config.ldif__#cn=config");
+      } else {
+        // Retrieve the network group attached to the client connection
+        // and get a workflow to process the operation.
+        NetworkGroup ng = getClientConnection().getNetworkGroup();
+        workflow = ng.getWorkflowCandidate(bindDN);
+      }
       if (workflow == null)
       {
         // We have found no workflow for the requested base DN, just return

--
Gitblit v1.10.0