diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-04-04 12:51:00 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-04-10 16:40:05 +1000 |
commit | 57341c0f29911d09e511c840386a35290febb9f9 (patch) | |
tree | bf123480733183f26f4b5970c42e16dfd559339d /lib/ldb/tools/ldbdel.c | |
parent | d425a4cd3dded853aaefbca8873c95845933d383 (diff) | |
download | samba-57341c0f29911d09e511c840386a35290febb9f9.tar.gz samba-57341c0f29911d09e511c840386a35290febb9f9.tar.bz2 samba-57341c0f29911d09e511c840386a35290febb9f9.zip |
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
Diffstat (limited to 'lib/ldb/tools/ldbdel.c')
-rw-r--r-- | lib/ldb/tools/ldbdel.c | 8 |
1 files changed, 4 insertions, 4 deletions
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"); } |