From 79e1a71e5673de5d2e5bf78c7c2adbcd59bbc004 Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Thu, 9 Dec 2010 04:31:14 +0200 Subject: s4-dsdb_schema: Seize using global_schema when referencing new schema for an LDB Without this change, when a schema is set to ldb, the effect is that dsdb_get_schema() returns global_schema preferably. Thus we end up with two schemas in effect: - global one, which is the old one and it is still used everywhere - new one, which is just cached in ldb, but can't be used, as there is no way to access it --- source4/dsdb/schema/schema_set.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source4/dsdb/schema/schema_set.c b/source4/dsdb/schema/schema_set.c index 21341157fe..004d7eb3a3 100644 --- a/source4/dsdb/schema/schema_set.c +++ b/source4/dsdb/schema/schema_set.c @@ -452,6 +452,12 @@ int dsdb_reference_schema(struct ldb_context *ldb, struct dsdb_schema *schema, return ldb_oom(ldb); } + /* Make this ldb use local schema preferably */ + ret = ldb_set_opaque(ldb, "dsdb_use_global_schema", NULL); + if (ret != LDB_SUCCESS) { + return ret; + } + ret = dsdb_schema_set_attributes(ldb, schema, write_attributes); if (ret != LDB_SUCCESS) { return ret; -- cgit