From 30273925a9cd0da65e289ef79c9116a40a3c9abf Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Wed, 25 Apr 2007 04:19:06 +0000
Subject: [PATCH] Update the config file handler so that it will reject any modification which attempts to change the structural object class for an entry.

---
 opends/src/server/org/opends/server/extensions/ConfigFileHandler.java |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/ConfigFileHandler.java b/opends/src/server/org/opends/server/extensions/ConfigFileHandler.java
index 584d5b0..2e50169 100644
--- a/opends/src/server/org/opends/server/extensions/ConfigFileHandler.java
+++ b/opends/src/server/org/opends/server/extensions/ConfigFileHandler.java
@@ -1408,6 +1408,17 @@
       }
 
 
+      // If the structural class is different between the current entry and the
+      // new entry, then reject the change.
+      if (! currentEntry.getEntry().getStructuralObjectClass().equals(
+                 entry.getStructuralObjectClass()))
+      {
+        int    msgID   = MSGID_CONFIG_FILE_MODIFY_STRUCTURAL_CHANGE_NOT_ALLOWED;
+        String message = getMessage(msgID, String.valueOf(entryDN));
+        throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message, msgID);
+      }
+
+
       // Create a new config entry to use for the validation testing.
       ConfigEntry newEntry = new ConfigEntry(e, currentEntry.getParent());
 

--
Gitblit v1.10.0