summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 8578e06c0d..501907578d 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -287,8 +287,10 @@ static int ltdb_dn_list_store(struct ldb_module *module, struct ldb_dn *dn,
rec.dsize = sizeof(void *);
ret = tdb_store(ltdb->idxptr->itdb, key, rec, TDB_INSERT);
-
- return ret;
+ if (ret == -1) {
+ return ltdb_err_map(tdb_error(ltdb->idxptr->itdb));
+ }
+ return LDB_SUCCESS;
}
/*
@@ -320,7 +322,10 @@ static int ltdb_index_traverse_store(struct tdb_context *tdb, TDB_DATA key, TDB_
ltdb->idxptr->error = ltdb_dn_list_store_full(module, dn, list);
talloc_free(dn);
- return ltdb->idxptr->error;
+ if (ltdb->idxptr->error != 0) {
+ return -1;
+ }
+ return 0;
}
/* cleanup the idxptr mode when transaction commits */