From f0db4ef0f870cd995ac0d11e0a4ed4d4591627e6 Mon Sep 17 00:00:00 2001
From: pgamba <pgamba@localhost>
Date: Fri, 15 Feb 2008 08:36:38 +0000
Subject: [PATCH] Fix 2904: "dsreplication enable" cannot initialize b11 from b10 because the schema initialization fails on the config schema. The code already tests whether the new objectclass is part of the config schema and then excludes it from the import. That's fine. Except that the test relies on the decoding of the OC and fails if the new OC comes with a new attribute. The fix consists in relaxing the decoding when doing the test .. and really doing a strict decoding after the test once we know the new OC is not a config OC.
---
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java b/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
index 3b17ff0..a6f7c1a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -4345,8 +4345,10 @@
{
for (AttributeValue v : a.getValues())
{
+ // It IS important here to allow the unknown elements that could
+ // appear in the new config schema.
ObjectClass newObjectClass = ObjectClassSyntax.decodeObjectClass(
- v.getValue(), newSchema, false);
+ v.getValue(), newSchema, true);
String schemaFile = newObjectClass.getSchemaFile();
if (schemaFile.equals(CONFIG_SCHEMA_ELEMENTS_FILE))
{
@@ -4356,6 +4358,11 @@
continue;
}
+ // Now we know we are not in the config schema, let's check
+ // the unknown elements ... sadly but simply by redoing the
+ // whole decoding.
+ newObjectClass = ObjectClassSyntax.decodeObjectClass(
+ v.getValue(), newSchema, false);
oidList.add(newObjectClass.getOID());
try
{
--
Gitblit v1.10.0