From 4631723c988b46be8af4e67f5aea9187b08b9187 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 11 Aug 2012 12:29:06 +1000 Subject: 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 Autobuild-Date(master): Sat Aug 11 10:31:57 CEST 2012 on sn-devel-104 --- source4/dsdb/samdb/ldb_modules/schema_load.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/dsdb/samdb/ldb_modules') 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; -- cgit