From 2cf46088b7e69b4f424a821291607afe6faa7e4f Mon Sep 17 00:00:00 2001
From: Yuriy Movchan <Yuriy.Movchan@gmail.com>
Date: Fri, 30 Jul 2021 14:08:39 +0000
Subject: [PATCH] Add FIPS support (#176)

---
 opendj-server-legacy/src/main/java/org/opends/server/config/ConfigurationHandler.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigurationHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigurationHandler.java
index 42fea94..ae4c812 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigurationHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigurationHandler.java
@@ -589,10 +589,12 @@
    *          The original entry that is being replaced.
    * @param newEntry
    *          The new entry to use in place of the existing entry with the same DN.
+   * @param structuralUpdate
+   *          Force objectClass update.
    * @throws DirectoryException
    *           If a problem occurs while trying to replace the entry.
    */
-  public void replaceEntry(final Entry oldEntry, final Entry newEntry) throws DirectoryException
+  public void replaceEntry(final Entry oldEntry, final Entry newEntry, final boolean structuralUpdate) throws DirectoryException
   {
     final DN newEntryDN = newEntry.getName();
     if (!backend.contains(newEntryDN))
@@ -601,7 +603,7 @@
           ERR_CONFIG_FILE_MODIFY_NO_SUCH_ENTRY.get(oldEntry), getMatchedDN(newEntryDN), null);
     }
 
-    if (!Entries.getStructuralObjectClass(oldEntry, serverContext.getSchema()).equals(
+    if (!structuralUpdate && !Entries.getStructuralObjectClass(oldEntry, serverContext.getSchema()).equals(
         Entries.getStructuralObjectClass(newEntry, serverContext.getSchema())))
     {
       throw new DirectoryException(ResultCode.NO_SUCH_OBJECT,
@@ -657,6 +659,11 @@
     }
   }
 
+  public void replaceEntry(final Entry oldEntry, final Entry newEntry) throws DirectoryException
+  {
+	  replaceEntry(oldEntry, newEntry, false);
+  }
+
   @Override
   public void registerAddListener(final DN dn, final ConfigAddListener listener)
   {

--
Gitblit v1.10.0