From 84ad5fc9f3d1a4caad749cea84756028f4a649d2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 17 Oct 2005 11:26:23 +0000 Subject: r11109: fixed the error code return from most ldb functions (the change to use ldb_transaction_cancel() broke it) (This used to be commit dc41994ea72c7c7f571efa009930cf36d7a9897a) --- source4/lib/ldb/common/ldb.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'source4/lib/ldb/common') diff --git a/source4/lib/ldb/common/ldb.c b/source4/lib/ldb/common/ldb.c index d34ddb4c8a..abd2c03aa3 100644 --- a/source4/lib/ldb/common/ldb.c +++ b/source4/lib/ldb/common/ldb.c @@ -168,8 +168,6 @@ int ldb_transaction_cancel(struct ldb_context *ldb) return LDB_ERR_OPERATIONS_ERROR; } - ldb_reset_err_string(ldb); - return module->ops->del_transaction(module); } @@ -246,7 +244,10 @@ int ldb_add(struct ldb_context *ldb, if (status != LDB_SUCCESS) return status; status = module->ops->add_record(module, message); - if (status != LDB_SUCCESS) return ldb_transaction_cancel(ldb); + if (status != LDB_SUCCESS) { + ldb_transaction_cancel(ldb); + return status; + } return ldb_transaction_commit(ldb); } @@ -274,7 +275,10 @@ int ldb_modify(struct ldb_context *ldb, if (status != LDB_SUCCESS) return status; status = module->ops->modify_record(module, message); - if (status != LDB_SUCCESS) return ldb_transaction_cancel(ldb); + if (status != LDB_SUCCESS) { + ldb_transaction_cancel(ldb); + return status; + } return ldb_transaction_commit(ldb); } @@ -299,7 +303,10 @@ int ldb_delete(struct ldb_context *ldb, const struct ldb_dn *dn) if (status != LDB_SUCCESS) return status; status = module->ops->delete_record(module, dn); - if (status != LDB_SUCCESS) return ldb_transaction_cancel(ldb); + if (status != LDB_SUCCESS) { + ldb_transaction_cancel(ldb); + return status; + } return ldb_transaction_commit(ldb); } @@ -323,7 +330,10 @@ int ldb_rename(struct ldb_context *ldb, const struct ldb_dn *olddn, const struct if (status != LDB_SUCCESS) return status; status = module->ops->rename_record(module, olddn, newdn); - if (status != LDB_SUCCESS) return ldb_transaction_cancel(ldb); + if (status != LDB_SUCCESS) { + ldb_transaction_cancel(ldb); + return status; + } return ldb_transaction_commit(ldb); } -- cgit