summaryrefslogtreecommitdiff
path: root/src/tools/sss_useradd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/sss_useradd.c')
-rw-r--r--src/tools/sss_useradd.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/tools/sss_useradd.c b/src/tools/sss_useradd.c
index 6c6b5851..6198dcae 100644
--- a/src/tools/sss_useradd.c
+++ b/src/tools/sss_useradd.c
@@ -255,22 +255,23 @@ int main(int argc, const char **argv)
goto fini;
}
- start_transaction(tctx);
+ tctx->error = sysdb_transaction_start(tctx->sysdb);
if (tctx->error != EOK) {
goto done;
}
/* useradd */
- ret = useradd(tctx, tctx->ev, tctx->sysdb, tctx->handle, tctx->octx);
- if (ret != EOK) {
- tctx->error = ret;
-
+ tctx->error = useradd(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);
+ if (tctx->error) {
+ goto done;
+ }
/* Set SELinux login context - must be done after transaction is done
* b/c libselinux calls getpwnam */