diff options
author | Sumit Bose <sbose@redhat.com> | 2009-12-17 21:28:47 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-18 09:46:25 -0500 |
commit | 6b94e84a0455ebb68506e70cf8ccc2a4656a2c91 (patch) | |
tree | af16ff432abe55af2b476465c57b85c46e2261c5 /server/providers/krb5/krb5_auth.c | |
parent | f4284f4791e5f84193d70d82eaa7465a26813731 (diff) | |
download | sssd-6b94e84a0455ebb68506e70cf8ccc2a4656a2c91.tar.gz sssd-6b94e84a0455ebb68506e70cf8ccc2a4656a2c91.tar.bz2 sssd-6b94e84a0455ebb68506e70cf8ccc2a4656a2c91.zip |
Fix for #344
Do not handle a missing ccache file as inactive by default, check if
there are still active processes of the user.
Diffstat (limited to 'server/providers/krb5/krb5_auth.c')
-rw-r--r-- | server/providers/krb5/krb5_auth.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/server/providers/krb5/krb5_auth.c b/server/providers/krb5/krb5_auth.c index 6e63c30a..71f4b919 100644 --- a/server/providers/krb5/krb5_auth.c +++ b/server/providers/krb5/krb5_auth.c @@ -144,20 +144,18 @@ static errno_t check_if_ccache_file_is_used(uid_t uid, const char *ccname, if (ret == -1 && errno != ENOENT) { DEBUG(1, ("stat failed [%d][%s].\n", errno, strerror(errno))); return errno; - } else if (ret == -1 && errno == ENOENT) { - return EOK; - } - - if (stat_buf.st_uid != uid) { - DEBUG(1, ("Cache file [%s] exists, but is owned by [%d] instead of " - "[%d].\n", filename, stat_buf.st_uid, uid)); - return EINVAL; - } + } else if (ret == EOK) { + if (stat_buf.st_uid != uid) { + DEBUG(1, ("Cache file [%s] exists, but is owned by [%d] instead of " + "[%d].\n", filename, stat_buf.st_uid, uid)); + return EINVAL; + } - if (!S_ISREG(stat_buf.st_mode)) { - DEBUG(1, ("Cache file [%s] exists, but is not a regular file.\n", - filename)); - return EINVAL; + if (!S_ISREG(stat_buf.st_mode)) { + DEBUG(1, ("Cache file [%s] exists, but is not a regular file.\n", + filename)); + return EINVAL; + } } ret = check_if_uid_is_active(uid, &active); |