diff options
author | Pavel Březina <pbrezina@redhat.com> | 2013-01-30 13:45:27 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-30 14:33:09 +0100 |
commit | e4d1e192430f6c76eee5b64decc3a799a0926979 (patch) | |
tree | a201bbbfe2922a2cd0819afdf6a29d722637561a | |
parent | c931d373501bff1d7386a6f7f5c955380d3a61ed (diff) | |
download | sssd-e4d1e192430f6c76eee5b64decc3a799a0926979.tar.gz sssd-e4d1e192430f6c76eee5b64decc3a799a0926979.tar.bz2 sssd-e4d1e192430f6c76eee5b64decc3a799a0926979.zip |
krb: recreate ccache if it was deleted
https://fedorahosted.org/sssd/ticket/1512
If directory where a ccache file was stored was missing and user
was still logged in, we erroneously considered the ccache file
still active. Thus the ccache file was not recreated and user was
unable to login.
-rw-r--r-- | src/providers/krb5/krb5_utils.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c index b770714b..7b56be52 100644 --- a/src/providers/krb5/krb5_utils.c +++ b/src/providers/krb5/krb5_utils.c @@ -770,8 +770,15 @@ cc_residual_is_used(uid_t uid, const char *ccname, ret = lstat(ccname, &stat_buf); - if (ret == -1 && errno != ENOENT) { + if (ret == -1) { ret = errno; + if (ret == ENOENT) { + DEBUG(SSSDBG_FUNC_DATA, ("Cache file [%s] does not exists, " + "it will be recreated\n", ccname)); + *result = false; + return EOK; + } + DEBUG(SSSDBG_OP_FAILURE, ("stat failed [%d][%s].\n", ret, strerror(ret))); return ret; |