From 6ea1223c5efc200e37739e751df9f39887cf8dcd Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Wed, 19 Sep 2012 16:02:00 +0200 Subject: DB: Cancel transaction in sysdb_store_user if sysdb_add_user fails --- src/db/sysdb_ops.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/db/sysdb_ops.c') diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 91fa21e9..33abd06b 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -1568,7 +1568,14 @@ int sysdb_store_user(struct sysdb_ctx *sysdb, ret = sysdb_add_user(sysdb, name, uid, gid, gecos, homedir, shell, attrs, cache_timeout, now); } - goto done; + + /* Handle the result of sysdb_add_user */ + if (ret == EOK) { + goto done; + } else { + DEBUG(SSSDBG_OP_FAILURE, ("Could not add user\n")); + goto fail; + } } /* the user exists, let's just replace attributes when set */ -- cgit