1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

dsdb: The schema should be reloaded during the transaction

Reload the schema just after getting the tranaction lock
but before the transaction counter is bumped.

This ensures we reload the schema exactly once but with
the DB locked.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Garming Sam 2017-11-21 11:31:10 +13:00 committed by Andrew Bartlett
parent 8ac1646e92
commit 2a0e022738

View File

@ -572,6 +572,12 @@ static int schema_load_start_transaction(struct ldb_module *module)
talloc_get_type(ldb_module_get_private(module), struct schema_load_private_data);
struct ldb_context *ldb = ldb_module_get_ctx(module);
struct dsdb_schema *schema;
int ret;
ret = ldb_next_start_trans(module);
if (ret != LDB_SUCCESS) {
return ret;
}
/* Try the schema refresh now */
schema = dsdb_get_schema(ldb, NULL);
@ -582,7 +588,7 @@ static int schema_load_start_transaction(struct ldb_module *module)
}
private_data->in_transaction++;
return ldb_next_start_trans(module);
return ret;
}
static int schema_load_end_transaction(struct ldb_module *module)