summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-10-17 11:26:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:44:51 -0500
commit84ad5fc9f3d1a4caad749cea84756028f4a649d2 (patch)
treebd3e0e7769e88074b226fe3ed68778cf1b753ac3 /source4
parent91366a1c96f18f6911e0b143de6df6a9490470d4 (diff)
downloadsamba-84ad5fc9f3d1a4caad749cea84756028f4a649d2.tar.gz
samba-84ad5fc9f3d1a4caad749cea84756028f4a649d2.tar.bz2
samba-84ad5fc9f3d1a4caad749cea84756028f4a649d2.zip
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)
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/common/ldb.c22
1 files changed, 16 insertions, 6 deletions
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);
}