From 43e9daa652d67d20d2955848b226a639f22bb826 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 05 Jul 2007 06:10:49 +0000
Subject: [PATCH] Update the internal root connection to ensure that it always inherits a default set of privileges, even if the administrator has taken those privileges out of the set granted to other root users by default.  The privileges that will always be granted to the internal root connection include:

---
 opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java b/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
index 64e3113..1b6e445 100644
--- a/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
+++ b/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -57,6 +57,7 @@
 import org.opends.server.types.AbstractOperation;
 import org.opends.server.types.Attribute;
 import org.opends.server.types.AttributeType;
+import org.opends.server.types.AttributeValue;
 import org.opends.server.types.AuthenticationInfo;
 import org.opends.server.types.ByteString;
 import org.opends.server.types.CancelRequest;
@@ -75,6 +76,7 @@
 import org.opends.server.types.Modification;
 import org.opends.server.types.ObjectClass;
 import org.opends.server.types.Operation;
+import org.opends.server.types.Privilege;
 import org.opends.server.types.RDN;
 import org.opends.server.types.RawAttribute;
 import org.opends.server.types.RawFilter;
@@ -202,6 +204,23 @@
       LinkedHashMap<AttributeType,List<Attribute>> operationalAttrs =
            new LinkedHashMap<AttributeType,List<Attribute>>();
 
+      AttributeType privType =
+           DirectoryServer.getAttributeType(OP_ATTR_PRIVILEGE_NAME,
+                                            true);
+
+      LinkedHashSet<AttributeValue> values =
+           new LinkedHashSet<AttributeValue>();
+      for (Privilege p : Privilege.getDefaultRootPrivileges())
+      {
+        values.add(new AttributeValue(privType, p.getName()));
+      }
+      Attribute privAttr =
+           new Attribute(privType, OP_ATTR_PRIVILEGE_NAME, values);
+      attrList = new LinkedList<Attribute>();
+      attrList.add(privAttr);
+
+      operationalAttrs.put(privType, attrList);
+
 
       DN internalUserDN = DN.decode(fullDNString);
       Entry internalUserEntry =

--
Gitblit v1.10.0