summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/ldb_tdb/ldb_cache.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_cache.c b/lib/ldb/ldb_tdb/ldb_cache.c
index e54ceaaa98..0b93021884 100644
--- a/lib/ldb/ldb_tdb/ldb_cache.c
+++ b/lib/ldb/ldb_tdb/ldb_cache.c
@@ -308,9 +308,17 @@ int ltdb_cache_load(struct ldb_module *module)
/* possibly initialise the baseinfo */
if (r == LDB_ERR_NO_SUCH_OBJECT) {
- if (ltdb_baseinfo_init(module) != LDB_SUCCESS) {
+
+ if (tdb_transaction_start(ltdb->tdb) != 0) {
goto failed;
}
+
+ /* error handling for ltdb_baseinfo_init() is by
+ looking for the record again. */
+ ltdb_baseinfo_init(module);
+
+ tdb_transaction_commit(ltdb->tdb);
+
if (ltdb_search_dn1(module, baseinfo_dn, baseinfo) != LDB_SUCCESS) {
goto failed;
}