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/ldbutil.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'lib/ldb/tools/ldbutil.c') diff --git a/lib/ldb/tools/ldbutil.c b/lib/ldb/tools/ldbutil.c index 882bc67be5..26f252704c 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, bool do_transaction) + struct ldb_control **controls) { struct ldb_request *req; int ret; @@ -87,8 +87,7 @@ int ldb_add_ctrl(struct ldb_context *ldb, if (ret != LDB_SUCCESS) return ret; /* do request and autostart a transaction */ - if (do_transaction) - ret = ldb_do_autotransaction(ldb, req); + ret = ldb_do_autotransaction(ldb, req); talloc_free(req); return ret; @@ -98,7 +97,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, bool do_transaction) + struct ldb_control **controls) { struct ldb_request *req; int ret; @@ -113,8 +112,7 @@ int ldb_delete_ctrl(struct ldb_context *ldb, struct ldb_dn *dn, if (ret != LDB_SUCCESS) return ret; /* do request and autostart a transaction */ - if (do_transaction) - ret = ldb_do_autotransaction(ldb, req); + ret = ldb_do_autotransaction(ldb, req); talloc_free(req); return ret; @@ -126,7 +124,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, bool do_transaction) + struct ldb_control **controls) { struct ldb_request *req; int ret; @@ -146,8 +144,7 @@ int ldb_modify_ctrl(struct ldb_context *ldb, if (ret != LDB_SUCCESS) return ret; /* do request and autostart a transaction */ - if (do_transaction) - ret = ldb_do_autotransaction(ldb, req); + ret = ldb_do_autotransaction(ldb, req); talloc_free(req); return ret; -- cgit