diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-09-19 16:02:00 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-09-20 17:55:21 +0200 |
commit | 6ea1223c5efc200e37739e751df9f39887cf8dcd (patch) | |
tree | 1df23c1c9678e5259f6bf79cc48bf91f73961e81 /src | |
parent | bd5790f9b213013a16e40a6fe79cbd11ddf567e4 (diff) | |
download | sssd-6ea1223c5efc200e37739e751df9f39887cf8dcd.tar.gz sssd-6ea1223c5efc200e37739e751df9f39887cf8dcd.tar.xz sssd-6ea1223c5efc200e37739e751df9f39887cf8dcd.zip |
DB: Cancel transaction in sysdb_store_user if sysdb_add_user fails
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb_ops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 91fa21e96..33abd06b2 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 */ |