From be1c7c1f4ce88b5175e7a946c0745cd9f9e7873b Mon Sep 17 00:00:00 2001
From: coulbeck <coulbeck@localhost>
Date: Fri, 02 Mar 2007 17:34:59 +0000
Subject: [PATCH] Fix for issue #1309: Deleting ACI is Ineffective. This was caused by a null pointer exception that we previously got away with but became noticable since the ACI cache update is now atomic.

---
 opends/src/server/org/opends/server/authorization/dseecompat/AciList.java |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/opends/src/server/org/opends/server/authorization/dseecompat/AciList.java b/opends/src/server/org/opends/server/authorization/dseecompat/AciList.java
index f9d2b24..de2c477 100644
--- a/opends/src/server/org/opends/server/authorization/dseecompat/AciList.java
+++ b/opends/src/server/org/opends/server/authorization/dseecompat/AciList.java
@@ -143,6 +143,10 @@
     List<Attribute> attributeList =
          entry.getOperationalAttribute(AciHandler.aciType);
 
+    if (attributeList == null) {
+      return 0;
+    }
+
     // Copy the ACI list.
     LinkedHashMap<DN,List<Aci>> aciCopy = copyList();
 
@@ -166,6 +170,11 @@
   private static int addAciAttributeList(
        LinkedHashMap<DN,List<Aci>> aciList, DN dn,
        List<Attribute> attributeList) {
+
+    if (attributeList == null) {
+      return 0;
+    }
+
     int validAcis=0;
     ArrayList<Aci> acis = new ArrayList<Aci>();
     for (Attribute attribute : attributeList) {
@@ -212,7 +221,7 @@
 
       aciCopy.remove(oldEntry.getDN());
       List<Attribute> attributeList =
-           newEntry.getOperationalAttribute(AciHandler.aciType, null);
+           newEntry.getOperationalAttribute(AciHandler.aciType);
       addAciAttributeList(aciCopy,newEntry.getDN(),attributeList);
 
       // Replace the ACI list with the copy.

--
Gitblit v1.10.0