summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/schema_load.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-11 12:29:06 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-11 10:31:57 +0200
commit4631723c988b46be8af4e67f5aea9187b08b9187 (patch)
tree0642d2b7d2c4ffd85d0a6a218b2c929f59b9e086 /source4/dsdb/samdb/ldb_modules/schema_load.c
parent329e3749381fee4182fdbf6015a42e4bdca07168 (diff)
downloadsamba-4631723c988b46be8af4e67f5aea9187b08b9187.tar.gz
samba-4631723c988b46be8af4e67f5aea9187b08b9187.tar.bz2
samba-4631723c988b46be8af4e67f5aea9187b08b9187.zip
s4-dsdb: Take more care in handling of global schema memory
This reworks dsdb_replicated_objects_commit() to have a proper local tmp_ctx and to be more careful about what schema is set (only setting a global schema if the original schema was global). In particular, the new working_schema is not given a talloc reference to the old schema. This ensures that the old schema can go away when no longer used. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Aug 11 10:31:57 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/schema_load.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema_load.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c
index 2521cab367..82ae7d84dd 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_load.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_load.c
@@ -320,7 +320,9 @@ static int dsdb_schema_from_db(struct ldb_module *module, struct ldb_dn *schema_
goto failed;
}
- /* Ensure this module won't go away before the callback */
+ /* Ensure this module won't go away before the callback. This
+ * causes every schema to have the LDB that originally loaded
+ * the first schema as a talloc child. */
if (talloc_reference(*schema, ldb) == NULL) {
ldb_oom(ldb);
ret = LDB_ERR_OPERATIONS_ERROR;