summaryrefslogtreecommitdiff
path: root/source4/dsdb/schema
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-12-09 04:31:14 +0200
committerKamen Mazdrashki <kamenim@samba.org>2010-12-15 00:51:18 +0100
commit79e1a71e5673de5d2e5bf78c7c2adbcd59bbc004 (patch)
treece6d0cb24bb79cac842bac13b0c10a1c40a3c46d /source4/dsdb/schema
parent4bcedda7d8c446bb3864312881aa63b892b55b7e (diff)
downloadsamba-79e1a71e5673de5d2e5bf78c7c2adbcd59bbc004.tar.gz
samba-79e1a71e5673de5d2e5bf78c7c2adbcd59bbc004.tar.bz2
samba-79e1a71e5673de5d2e5bf78c7c2adbcd59bbc004.zip
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
Diffstat (limited to 'source4/dsdb/schema')
-rw-r--r--source4/dsdb/schema/schema_set.c6
1 files changed, 6 insertions, 0 deletions
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;