From 2964e0f4cbf0dcee17b1d333a0ac3312e9a5370d Mon Sep 17 00:00:00 2001
From: floblanc <floblanc@localhost>
Date: Wed, 29 Oct 2008 10:40:13 +0000
Subject: [PATCH] Implement a network group dedicated to the admin connector: - this network group is not configurable, and unbreakable - all connections handled by the admin connector are managed by this network group - all JMX connections are managed by this network group - this network group provides access to all private and public suffixes

---
 opends/src/server/org/opends/server/plugins/NetworkGroupPlugin.java |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/opends/src/server/org/opends/server/plugins/NetworkGroupPlugin.java b/opends/src/server/org/opends/server/plugins/NetworkGroupPlugin.java
index 546a17c..b643a5f 100644
--- a/opends/src/server/org/opends/server/plugins/NetworkGroupPlugin.java
+++ b/opends/src/server/org/opends/server/plugins/NetworkGroupPlugin.java
@@ -177,7 +177,7 @@
           ArrayList<Message> messages)
   {
     boolean fullCheck = false;
-    if (connection.mustEvaluateNetworkGroup()) {
+    if (connection.mustEvaluateNetworkGroup(operation)) {
         NetworkGroup ng = NetworkGroup.findMatchingNetworkGroup(connection);
         if (ng != connection.getNetworkGroup()) {
           connection.setNetworkGroup(ng);
@@ -230,24 +230,26 @@
     ArrayList<Message> messages = new ArrayList<Message>();
     ClientConnection connection = bindOperation.getClientConnection();
     boolean fullCheck = false;
-    DN dn;
-    try {
-      dn = DN.decode(bindOperation.getRawBindDN());
-    } catch (DirectoryException ex) {
-      return PluginResult.PreParse.stopProcessing(ResultCode.OPERATIONS_ERROR,
-              ex.getMessageObject());
+
+    if (connection.mustEvaluateNetworkGroup(bindOperation)) {
+      DN dn;
+      try {
+        dn = DN.decode(bindOperation.getRawBindDN());
+      } catch (DirectoryException ex) {
+        return PluginResult.PreParse.stopProcessing(ResultCode.OPERATIONS_ERROR,
+                ex.getMessageObject());
+      }
+      AuthenticationType authType = bindOperation.getAuthenticationType();
+
+      NetworkGroup ng = NetworkGroup.findBindMatchingNetworkGroup(connection,
+            dn, authType, connection.isSecure());
+
+      if (ng != connection.getNetworkGroup()) {
+        connection.setNetworkGroup(ng);
+        fullCheck = true;
+      }
+      connection.mustEvaluateNetworkGroup(false);
     }
-    AuthenticationType authType = bindOperation.getAuthenticationType();
-
-    NetworkGroup ng = NetworkGroup.findBindMatchingNetworkGroup(connection, dn,
-            authType, connection.isSecure());
-
-    if (ng != connection.getNetworkGroup()) {
-      connection.setNetworkGroup(ng);
-      fullCheck = true;
-    }
-    connection.mustEvaluateNetworkGroup(false);
-
     if (!checkNetworkGroup(connection, bindOperation, fullCheck, messages)) {
       return PluginResult.PreParse.stopProcessing(
               ResultCode.ADMIN_LIMIT_EXCEEDED, messages.get(0));

--
Gitblit v1.10.0