From 57341c0f29911d09e511c840386a35290febb9f9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 4 Apr 2012 12:51:00 +1000 Subject: Revert "ldb: Permit desactivation of autocomit for every ldb_xxx_ctrl function" This reverts commit 40a4aea8918c2637703af03383f440d068820e48. Autocommit is important, as otherwise an ldb module could error out during an operation, and leave an corrupt database. Andrew Bartlett --- lib/ldb/tools/ldbdel.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/ldb/tools/ldbdel.c') diff --git a/lib/ldb/tools/ldbdel.c b/lib/ldb/tools/ldbdel.c index ae042dae5f..8036d09a70 100644 --- a/lib/ldb/tools/ldbdel.c +++ b/lib/ldb/tools/ldbdel.c @@ -41,7 +41,7 @@ static int dn_cmp(struct ldb_message **msg1, struct ldb_message **msg2) return ldb_dn_compare((*msg1)->dn, (*msg2)->dn); } -static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn,struct ldb_control **req_ctrls, bool doautocommit) +static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn,struct ldb_control **req_ctrls) { int ret; unsigned int i, total=0; @@ -55,7 +55,7 @@ static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn,struc TYPESAFE_QSORT(res->msgs, res->count, dn_cmp); for (i = 0; i < res->count; i++) { - if (ldb_delete_ctrl(ldb, res->msgs[i]->dn,req_ctrls, doautocommit) == LDB_SUCCESS) { + if (ldb_delete_ctrl(ldb, res->msgs[i]->dn,req_ctrls) == LDB_SUCCESS) { total++; } else { printf("Failed to delete '%s' - %s\n", @@ -114,9 +114,9 @@ int main(int argc, const char **argv) return LDB_ERR_OPERATIONS_ERROR; } if (options->recursive) { - ret = ldb_delete_recursive(ldb, dn,req_ctrls, !options->noautocommit); + ret = ldb_delete_recursive(ldb, dn,req_ctrls); } else { - ret = ldb_delete_ctrl(ldb, dn,req_ctrls, !options->noautocommit); + ret = ldb_delete_ctrl(ldb, dn,req_ctrls); if (ret == LDB_SUCCESS) { printf("Deleted 1 record\n"); } -- cgit