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>
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);
}
private_data->in_transaction++;
- return ldb_next_start_trans(module);
+ return ret;
}
static int schema_load_end_transaction(struct ldb_module *module)