From e5783d9d5e678cb4b8d69d98162c26d2858bbe33 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 25 Jan 2007 01:59:52 +0000
Subject: [PATCH] Make a number of updates to schema processing, all of which fall under the umbrella of issue #1163.  The individual issues addressed include:

---
 opends/src/server/org/opends/server/core/ModifyDNOperation.java |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/ModifyDNOperation.java b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
index 2f44f55..70da684 100644
--- a/opends/src/server/org/opends/server/core/ModifyDNOperation.java
+++ b/opends/src/server/org/opends/server/core/ModifyDNOperation.java
@@ -1486,7 +1486,8 @@
         if (DirectoryServer.checkSchema())
         {
           StringBuilder invalidReason = new StringBuilder();
-          if (! newEntry.conformsToSchema(null, false, invalidReason))
+          if (! newEntry.conformsToSchema(null, false, true, true,
+                                          invalidReason))
           {
             setResultCode(ResultCode.OBJECTCLASS_VIOLATION);
             appendErrorMessage(getMessage(MSGID_MODDN_VIOLATES_SCHEMA,
@@ -1494,6 +1495,19 @@
                                           String.valueOf(invalidReason)));
             break modifyDNProcessing;
           }
+
+          for (int i=0; i < newRDNValues; i++)
+          {
+            AttributeType at = newRDN.getAttributeType(i);
+            if (at.isObsolete())
+            {
+              setResultCode(ResultCode.CONSTRAINT_VIOLATION);
+              appendErrorMessage(getMessage(MSGID_MODDN_NEWRDN_ATTR_IS_OBSOLETE,
+                                            String.valueOf(entryDN),
+                                            at.getNameOrOID()));
+              break modifyDNProcessing;
+            }
+          }
         }
 
 
@@ -1697,7 +1711,8 @@
           if (DirectoryServer.checkSchema())
           {
             StringBuilder invalidReason = new StringBuilder();
-            if (! newEntry.conformsToSchema(null, false, invalidReason))
+            if (! newEntry.conformsToSchema(null, false, true, true,
+                                            invalidReason))
             {
               setResultCode(ResultCode.OBJECTCLASS_VIOLATION);
 

--
Gitblit v1.10.0