From c08575b5d155b34529c402d7e5398e77abc49117 Mon Sep 17 00:00:00 2001
From: gbellato <gbellato@localhost>
Date: Mon, 20 Aug 2007 08:04:16 +0000
Subject: [PATCH] These changes rovides the ability to repair the consistency in the replication topology in the (hopefully) rare case when hardware failure or software bugs could break it (issue 788 and 791)
---
opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
index a806599..0e7f481 100644
--- a/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
+++ b/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendWorkflowElement.java
@@ -4702,6 +4702,47 @@
}
}
+ // If the attribute type is marked "NO-USER-MODIFICATION" then fail
+ // unless this is an internal operation or is related to
+ // synchronization in some way.
+ // This must be done before running the password policy code
+ // and any other code that may add attributes marked as
+ // "NO-USER-MODIFICATION"
+ //
+ // Note that doing this checks at this time
+ // of the processing does not make it possible for pre-parse plugins
+ // to add NO-USER-MODIFICATION attributes to the entry.
+ for (AttributeType at : userAttributes.keySet())
+ {
+ if (at.isNoUserModification())
+ {
+ if (! (localOp.isInternalOperation() ||
+ localOp.isSynchronizationOperation()))
+ {
+ localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
+ localOp.appendErrorMessage(ERR_ADD_ATTR_IS_NO_USER_MOD.get(
+ String.valueOf(entryDN), at.getNameOrOID()));
+
+ break addProcessing;
+ }
+ }
+ }
+
+ for (AttributeType at : operationalAttributes.keySet())
+ {
+ if (at.isNoUserModification())
+ {
+ if (! (localOp.isInternalOperation() ||
+ localOp.isSynchronizationOperation()))
+ {
+ localOp.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
+ localOp.appendErrorMessage(ERR_ADD_ATTR_IS_NO_USER_MOD.get(
+ String.valueOf(entryDN), at.getNameOrOID()));
+
+ break addProcessing;
+ }
+ }
+ }
// Check to see if the entry already exists. We do this before
// checking whether the parent exists to ensure a referral entry
--
Gitblit v1.10.0