summaryrefslogtreecommitdiff
path: root/lib/ldb/tools/ldbutil.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/ldbutil.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/ldbutil.c')
-rw-r--r--lib/ldb/tools/ldbutil.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/ldb/tools/ldbutil.c b/lib/ldb/tools/ldbutil.c
index 26f252704c..882bc67be5 100644
--- a/lib/ldb/tools/ldbutil.c
+++ b/lib/ldb/tools/ldbutil.c
@@ -67,7 +67,7 @@ static int ldb_do_autotransaction(struct ldb_context *ldb,
*/
int ldb_add_ctrl(struct ldb_context *ldb,
const struct ldb_message *message,
- struct ldb_control **controls)
+ struct ldb_control **controls, bool do_transaction)
{
struct ldb_request *req;
int ret;
@@ -87,7 +87,8 @@ int ldb_add_ctrl(struct ldb_context *ldb,
if (ret != LDB_SUCCESS) return ret;
/* do request and autostart a transaction */
- ret = ldb_do_autotransaction(ldb, req);
+ if (do_transaction)
+ ret = ldb_do_autotransaction(ldb, req);
talloc_free(req);
return ret;
@@ -97,7 +98,7 @@ int ldb_add_ctrl(struct ldb_context *ldb,
same as ldb_delete but accept control
*/
int ldb_delete_ctrl(struct ldb_context *ldb, struct ldb_dn *dn,
- struct ldb_control **controls)
+ struct ldb_control **controls, bool do_transaction)
{
struct ldb_request *req;
int ret;
@@ -112,7 +113,8 @@ int ldb_delete_ctrl(struct ldb_context *ldb, struct ldb_dn *dn,
if (ret != LDB_SUCCESS) return ret;
/* do request and autostart a transaction */
- ret = ldb_do_autotransaction(ldb, req);
+ if (do_transaction)
+ ret = ldb_do_autotransaction(ldb, req);
talloc_free(req);
return ret;
@@ -124,7 +126,7 @@ int ldb_delete_ctrl(struct ldb_context *ldb, struct ldb_dn *dn,
*/
int ldb_modify_ctrl(struct ldb_context *ldb,
const struct ldb_message *message,
- struct ldb_control **controls)
+ struct ldb_control **controls, bool do_transaction)
{
struct ldb_request *req;
int ret;
@@ -144,7 +146,8 @@ int ldb_modify_ctrl(struct ldb_context *ldb,
if (ret != LDB_SUCCESS) return ret;
/* do request and autostart a transaction */
- ret = ldb_do_autotransaction(ldb, req);
+ if (do_transaction)
+ ret = ldb_do_autotransaction(ldb, req);
talloc_free(req);
return ret;