summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-11 22:35:15 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-04-12 09:22:15 -0400
commitcc14edade621572cf4457d55d5b989029c5131ee (patch)
tree1fd1db93992a2d890f2d9e3115ad27b7b853181f /src/db/sysdb.c
parent24a947aac2ead046940e9c23ee8393a115ee47a3 (diff)
downloadsssd-cc14edade621572cf4457d55d5b989029c5131ee.tar.gz
sssd-cc14edade621572cf4457d55d5b989029c5131ee.tar.xz
sssd-cc14edade621572cf4457d55d5b989029c5131ee.zip
sysdb: add synchronous transaction functions
Diffstat (limited to 'src/db/sysdb.c')
-rw-r--r--src/db/sysdb.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 2daaa7bc6..1f75bbe0a 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -669,6 +669,38 @@ void sysdb_transaction_complete(struct tevent_req *subreq)
tevent_req_done(req);
}
+int sysdb_transaction_start(struct sysdb_ctx *ctx)
+{
+ int ret;
+
+ ret = ldb_transaction_start(ctx->ldb);
+ if (ret != LDB_SUCCESS) {
+ DEBUG(1, ("Failed to start ldb transaction! (%d)\n", ret));
+ }
+ return sysdb_error_to_errno(ret);
+}
+
+int sysdb_transaction_commit(struct sysdb_ctx *ctx)
+{
+ int ret;
+
+ ret = ldb_transaction_commit(ctx->ldb);
+ if (ret != LDB_SUCCESS) {
+ DEBUG(1, ("Failed to commit ldb transaction! (%d)\n", ret));
+ }
+ return sysdb_error_to_errno(ret);
+}
+
+int sysdb_transaction_cancel(struct sysdb_ctx *ctx)
+{
+ int ret;
+
+ ret = ldb_transaction_cancel(ctx->ldb);
+ if (ret != LDB_SUCCESS) {
+ DEBUG(1, ("Failed to cancel ldb transaction! (%d)\n", ret));
+ }
+ return sysdb_error_to_errno(ret);
+}
/* =Operations============================================================ */