From d483c3bb960823cbf9a812872d6040bc390c48ca Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 22 Oct 2009 11:15:18 +1100 Subject: [PATCH] s4-ldb: fixed tdb error handling in ldb_index.c --- source4/lib/ldb/ldb_tdb/ldb_index.c | 11 ++++++++--- 1 file 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 8578e06c0de..501907578d9 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 */ -- 2.34.1