summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_utils.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-02-01 11:54:41 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-02-26 18:05:07 +0100
commit24ee49904e91590e192983df16818567c060e12b (patch)
tree1dcf721f50a05dfddcc36b24a94644b0755d1526 /src/providers/krb5/krb5_utils.c
parent6a2047c88d6abd9496e3cc1848d9ff0bd7b2423a (diff)
downloadsssd-24ee49904e91590e192983df16818567c060e12b.tar.gz
sssd-24ee49904e91590e192983df16818567c060e12b.tar.xz
sssd-24ee49904e91590e192983df16818567c060e12b.zip
Do not process success case in an else
Diffstat (limited to 'src/providers/krb5/krb5_utils.c')
-rw-r--r--src/providers/krb5/krb5_utils.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index 977186998..ad77c7cc8 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -782,34 +782,34 @@ cc_residual_is_used(uid_t uid, const char *ccname,
DEBUG(SSSDBG_OP_FAILURE,
("stat failed [%d][%s].\n", ret, strerror(ret)));
return ret;
- } else if (ret == EOK) {
- if (stat_buf.st_uid != uid) {
- DEBUG(SSSDBG_OP_FAILURE,
- ("Cache file [%s] exists, but is owned by [%d] instead of "
- "[%d].\n", ccname, stat_buf.st_uid, uid));
- return EINVAL;
- }
+ }
+
+ if (stat_buf.st_uid != uid) {
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("Cache file [%s] exists, but is owned by [%d] instead of "
+ "[%d].\n", ccname, stat_buf.st_uid, uid));
+ return EINVAL;
+ }
- switch (type) {
+ switch (type) {
#ifdef HAVE_KRB5_DIRCACHE
- case SSS_KRB5_TYPE_DIR:
- ret = S_ISDIR(stat_buf.st_mode);
- break;
+ case SSS_KRB5_TYPE_DIR:
+ ret = S_ISDIR(stat_buf.st_mode);
+ break;
#endif /* HAVE_KRB5_DIRCACHE */
- case SSS_KRB5_TYPE_FILE:
- ret = S_ISREG(stat_buf.st_mode);
- break;
- default:
- DEBUG(SSSDBG_CRIT_FAILURE, ("Unsupported ccache type\n"));
- return EINVAL;
- }
-
- if (ret == 0) {
- DEBUG(SSSDBG_OP_FAILURE,
- ("Cache file [%s] exists, but is not the expected type\n",
- ccname));
+ case SSS_KRB5_TYPE_FILE:
+ ret = S_ISREG(stat_buf.st_mode);
+ break;
+ default:
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Unsupported ccache type\n"));
return EINVAL;
- }
+ }
+
+ if (ret == 0) {
+ DEBUG(SSSDBG_OP_FAILURE,
+ ("Cache file [%s] exists, but is not the expected type\n",
+ ccname));
+ return EINVAL;
}
ret = check_if_uid_is_active(uid, &active);