summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-01-30 13:45:27 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-01-30 14:35:00 +0100
commitac85128159ba0c68b193a739493678e037c58697 (patch)
tree41c27e9179b92d64581ca58496b0e4d4bb6f3013 /src/providers
parent21483699958076825c56071dd51366ff4ecb278b (diff)
downloadsssd-ac85128159ba0c68b193a739493678e037c58697.tar.gz
sssd-ac85128159ba0c68b193a739493678e037c58697.tar.xz
sssd-ac85128159ba0c68b193a739493678e037c58697.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.
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/krb5/krb5_utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/providers/krb5/krb5_utils.c b/src/providers/krb5/krb5_utils.c
index f99b0f99f..c0019a08a 100644
--- a/src/providers/krb5/krb5_utils.c
+++ b/src/providers/krb5/krb5_utils.c
@@ -769,8 +769,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;