summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools/ldbedit.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-04 13:59:44 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-04 14:40:51 +1000
commitc298e660bd28140125f2ac6b47dff6d7c01e82ae (patch)
treecc7f4aba631ae803cc22fbb1654aa42db4e4260d /source4/lib/ldb/tools/ldbedit.c
parent5842aa1ffdedd192d2616a6593bc8d8464dde3cd (diff)
downloadsamba-c298e660bd28140125f2ac6b47dff6d7c01e82ae.tar.gz
samba-c298e660bd28140125f2ac6b47dff6d7c01e82ae.tar.bz2
samba-c298e660bd28140125f2ac6b47dff6d7c01e82ae.zip
ldb: ensure we cancel a ldb transaction
When we fail a ldbadd or ldbedit we should cancel the transaction to prevent ldb giving a warning about having a open transaction in the ldb destructor
Diffstat (limited to 'source4/lib/ldb/tools/ldbedit.c')
-rw-r--r--source4/lib/ldb/tools/ldbedit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c
index 9653eabcb9..ecadf0f61c 100644
--- a/source4/lib/ldb/tools/ldbedit.c
+++ b/source4/lib/ldb/tools/ldbedit.c
@@ -128,6 +128,7 @@ static int merge_edits(struct ldb_context *ldb,
fprintf(stderr, "failed to add %s - %s\n",
ldb_dn_get_linearized(msgs2[i]->dn),
ldb_errstring(ldb));
+ ldb_transaction_cancel(ldb);
return -1;
}
adds++;
@@ -149,6 +150,7 @@ static int merge_edits(struct ldb_context *ldb,
fprintf(stderr, "failed to delete %s - %s\n",
ldb_dn_get_linearized(msgs1[i]->dn),
ldb_errstring(ldb));
+ ldb_transaction_cancel(ldb);
return -1;
}
deletes++;