make sure we update the current schema->prefixes when we add a new prefix
authorAndrew Tridgell <tridge@samba.org>
Mon, 17 Aug 2009 01:13:23 +0000 (11:13 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 17 Aug 2009 01:14:12 +0000 (11:14 +1000)
This triggered a failure in the updateNow schema test, as the current
global schema was not being updated when a new schema element was
added

source4/dsdb/schema/schema_init.c

index dfa745e305c62dce23616b0e58112124d8ddbaec..170d5a12e970bddaf2be81907bee862c74829973 100644 (file)
@@ -349,6 +349,13 @@ WERROR dsdb_create_prefix_mapping(struct ldb_context *ldb, struct dsdb_schema *s
                return status;
        }
 
+       talloc_free(schema->prefixes);
+       schema->prefixes = talloc_steal(schema, prefixes);
+       schema->num_prefixes = num_prefixes;
+
+       DEBUG(2,(__location__ " Added prefixMap %s - now have %u prefixes\n",
+                full_oid, num_prefixes));
+
        talloc_free(mem_ctx);
        return status;
 }
@@ -443,6 +450,8 @@ WERROR dsdb_find_prefix_for_oid(uint32_t num_prefixes, const struct dsdb_schema_
                return WERR_OK;
        }
 
+       DEBUG(5,(__location__ " Failed to find oid %s - have %u prefixes\n", in, num_prefixes));
+
        return WERR_DS_NO_MSDS_INTID;
 }