return LDB_SUCCESS;
}
+ /* This loads metadata tdb. If it's missing, creates it */
+ ret = partition_metadata_init(module);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+
ret = partition_reload_metadata(module, data, mem_ctx, &msg, parent);
if (ret != LDB_SUCCESS) {
talloc_free(mem_ctx);
return ldb_operr(ldb);
}
- /* This loads metadata tdb. If it's missing, creates it */
- ret = partition_metadata_init(module);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
-
return ldb_next_init(module);
}
data = talloc_get_type_abort(ldb_module_get_private(module),
struct partition_private_data);
+ if (data->metadata != NULL && data->metadata->db != NULL) {
+ return LDB_SUCCESS;
+ }
+
data->metadata = talloc_zero(data, struct partition_metadata);
if (data->metadata == NULL) {
return ldb_module_oom(module);