summaryrefslogtreecommitdiff
path: root/src/tools/sss_usermod.c
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-11 23:30:55 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-04-12 09:22:15 -0400
commit40bb1ddf0a3f69922466b2b99bcdaf7746fc81ba (patch)
treed1e643223e87a99166a5c8b0493582f76914feba /src/tools/sss_usermod.c
parent488d314e6a330b92516577fe889bde52393288b4 (diff)
downloadsssd-40bb1ddf0a3f69922466b2b99bcdaf7746fc81ba.tar.gz
sssd-40bb1ddf0a3f69922466b2b99bcdaf7746fc81ba.tar.bz2
sssd-40bb1ddf0a3f69922466b2b99bcdaf7746fc81ba.zip
Use the sysdb synchronous transaction functions
Diffstat (limited to 'src/tools/sss_usermod.c')
-rw-r--r--src/tools/sss_usermod.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tools/sss_usermod.c b/src/tools/sss_usermod.c
index 65431fa5..88e3fda3 100644
--- a/src/tools/sss_usermod.c
+++ b/src/tools/sss_usermod.c
@@ -218,22 +218,20 @@ int main(int argc, const char **argv)
tctx->octx->gid = pc_gid;
tctx->octx->lock = pc_lock;
- start_transaction(tctx);
+ tctx->error = sysdb_transaction_start(tctx->sysdb);
if (tctx->error != EOK) {
goto done;
}
/* usermod */
- ret = usermod(tctx, tctx->ev, tctx->sysdb, tctx->handle, tctx->octx);
- if (ret != EOK) {
- tctx->error = ret;
-
+ tctx->error = usermod(tctx, tctx->sysdb, tctx->octx);
+ if (tctx->error) {
/* cancel transaction */
- talloc_zfree(tctx->handle);
+ sysdb_transaction_cancel(tctx->sysdb);
goto done;
}
- end_transaction(tctx);
+ tctx->error = sysdb_transaction_commit(tctx->sysdb);
/* Set SELinux login context - must be done after transaction is done
* b/c libselinux calls getpwnam */