summaryrefslogtreecommitdiff
path: root/lib/ldb/tools/ldbdel.c
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2012-03-30 01:24:07 -0700
committerMatthieu Patou <mat@samba.org>2012-03-30 11:59:09 +0200
commit40a4aea8918c2637703af03383f440d068820e48 (patch)
tree2484c3b27227f190b69e1ae94b66ede966bf3631 /lib/ldb/tools/ldbdel.c
parent5df1c115391f2d673d3dd2dfb89146ce77639d41 (diff)
downloadsamba-40a4aea8918c2637703af03383f440d068820e48.tar.gz
samba-40a4aea8918c2637703af03383f440d068820e48.tar.bz2
samba-40a4aea8918c2637703af03383f440d068820e48.zip
ldb: Permit desactivation of autocomit for every ldb_xxx_ctrl function
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Fri Mar 30 11:59:09 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib/ldb/tools/ldbdel.c')
-rw-r--r--lib/ldb/tools/ldbdel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ldb/tools/ldbdel.c b/lib/ldb/tools/ldbdel.c
index 8036d09a70..ae042dae5f 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)
+static int ldb_delete_recursive(struct ldb_context *ldb, struct ldb_dn *dn,struct ldb_control **req_ctrls, bool doautocommit)
{
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) == LDB_SUCCESS) {
+ if (ldb_delete_ctrl(ldb, res->msgs[i]->dn,req_ctrls, doautocommit) == 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);
+ ret = ldb_delete_recursive(ldb, dn,req_ctrls, !options->noautocommit);
} else {
- ret = ldb_delete_ctrl(ldb, dn,req_ctrls);
+ ret = ldb_delete_ctrl(ldb, dn,req_ctrls, !options->noautocommit);
if (ret == LDB_SUCCESS) {
printf("Deleted 1 record\n");
}