From a2c3fde785f4dcab651ee75492a95d3f6c07a853 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 09 Dec 2013 16:10:36 +0000
Subject: [PATCH] OPENDJ-1106 fractional-replication: adding entry on a replica as DM should not exit with RC 50
---
opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java | 41 ++++++++++++++++-------------------------
1 files changed, 16 insertions(+), 25 deletions(-)
diff --git a/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java b/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
index 4cd3f86..4fb994d 100644
--- a/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -219,8 +219,7 @@
{
aciListenerMgr.finalizeListenerManager();
AciEffectiveRights.finalizeOnShutdown();
- DirectoryServer
- .deregisterSupportedControl(OID_GET_EFFECTIVE_RIGHTS);
+ DirectoryServer.deregisterSupportedControl(OID_GET_EFFECTIVE_RIGHTS);
}
@@ -371,8 +370,7 @@
AttributeType attributeType = getAttributeType(baseName);
AttributeValue attributeValue =
- AttributeValues.create(attributeType, operation
- .getAssertionValue());
+ AttributeValues.create(attributeType, operation.getAssertionValue());
container.setCurrentAttributeType(attributeType);
container.setCurrentAttributeValue(attributeValue);
return isAllowed(container, operation);
@@ -610,7 +608,7 @@
*/
boolean accessAllowed(AciContainer container)
{
- DN dn = container.getResourceEntry().getDN();
+ DN dn = container.getResourceDN();
// For ACI_WRITE_ADD and ACI_WRITE_DELETE set the ACI_WRITE
// right.
if (container.hasRights(ACI_WRITE_ADD)
@@ -839,9 +837,9 @@
// type are being replaced or deleted. If only a subset is being
// deleted than this access check is skipped.
ModificationType modType = m.getModificationType();
- if (((modType == ModificationType.DELETE) && modAttr.isEmpty())
- || ((modType == ModificationType.REPLACE)
- || (modType == ModificationType.INCREMENT)))
+ if ((modType == ModificationType.DELETE && modAttr.isEmpty())
+ || modType == ModificationType.REPLACE
+ || modType == ModificationType.INCREMENT)
{
/*
* Check if we have rights to delete all values of an attribute
@@ -851,8 +849,7 @@
{
container.setCurrentAttributeType(modAttrType);
List<Attribute> attrList =
- resourceEntry.getAttribute(modAttrType, modAttr
- .getOptions());
+ resourceEntry.getAttribute(modAttrType, modAttr.getOptions());
if (attrList != null)
{
for (Attribute a : attrList)
@@ -898,8 +895,7 @@
case INCREMENT:
Entry modifiedEntry = operation.getModifiedEntry();
List<Attribute> modifiedAttrs =
- modifiedEntry.getAttribute(modAttrType, modAttr
- .getOptions());
+ modifiedEntry.getAttribute(modAttrType, modAttr.getOptions());
if (modifiedAttrs != null)
{
for (Attribute attr : modifiedAttrs)
@@ -1272,10 +1268,8 @@
if (globalAcis != null)
{
aciList.addAci(DN.nullDN(), globalAcis);
- Message message =
- INFO_ACI_ADD_LIST_GLOBAL_ACIS.get(Integer
- .toString(globalAcis.size()));
- logError(message);
+ logError(INFO_ACI_ADD_LIST_GLOBAL_ACIS.get(
+ Integer.toString(globalAcis.size())));
}
}
catch (Exception e)
@@ -1284,9 +1278,8 @@
{
TRACER.debugCaught(DebugLogLevel.ERROR, e);
}
- Message message =
- INFO_ACI_HANDLER_FAIL_PROCESS_GLOBAL_ACI.get(String
- .valueOf(configuration.dn()));
+ Message message = INFO_ACI_HANDLER_FAIL_PROCESS_GLOBAL_ACI.get(
+ String.valueOf(configuration.dn()));
throw new InitializationException(message, e);
}
}
@@ -1480,9 +1473,8 @@
if (!operation.getClientConnection().hasPrivilege(
Privilege.MODIFY_ACL, operation))
{
- Message message =
- INFO_ACI_ADD_FAILED_PRIVILEGE.get(String.valueOf(entry
- .getDN()), String.valueOf(clientDN));
+ Message message = INFO_ACI_ADD_FAILED_PRIVILEGE.get(
+ String.valueOf(entry.getDN()), String.valueOf(clientDN));
logError(message);
return false;
}
@@ -1498,9 +1490,8 @@
}
catch (AciException ex)
{
- Message message =
- WARN_ACI_ADD_FAILED_DECODE.get(String.valueOf(entry
- .getDN()), ex.getMessage());
+ Message message = WARN_ACI_ADD_FAILED_DECODE.get(
+ String.valueOf(entry.getDN()), ex.getMessage());
throw new DirectoryException(
ResultCode.INVALID_ATTRIBUTE_SYNTAX, message);
}
--
Gitblit v1.10.0