aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2018-03-28 18:27:06 +0200
committerGreg Hudson <ghudson@mit.edu>2018-05-01 21:20:40 -0400
commite5c2e8323f9b30a993ae7a1577f091fbbc7e7768 (patch)
tree67cc4e7cfa94a37c9bd8dab718c85766ae479c75
parent6df6f46877cdec83944aa1e3579b77e5b0083f01 (diff)
downloadkrb5-e5c2e8323f9b30a993ae7a1577f091fbbc7e7768.zip
krb5-e5c2e8323f9b30a993ae7a1577f091fbbc7e7768.tar.gz
krb5-e5c2e8323f9b30a993ae7a1577f091fbbc7e7768.tar.bz2
Continue after KRB5_CC_END in KCM cache iteration
The KCM server returns KRB5_CC_END in response to a GET_CACHE_BY_UUID request to indicate that the specified ccache uuid no longer exists. In krb5_ptcursor_next(), ignore this error and continue the iteration, as the Heimdal KCM client code does. In addition to addressing the case where a third party deletes a cache between the GET_CACHE_UUID_LIST request and when we reach that uuid in the iteration, this change also fixes a bug in kdestroy -A where the caller deletes the primary cache and we later request it by uuid when iterating over the list. [ghudson@mit.edu: rewrote commit message; edited comment] (cherry picked from commit 49087f5e6309f298f8898c35af6f4ade418ced60) ticket: 8658 version_fixed: 1.15.3
-rw-r--r--src/lib/krb5/ccache/cc_kcm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/krb5/ccache/cc_kcm.c b/src/lib/krb5/ccache/cc_kcm.c
index a889e67..a3afd70 100644
--- a/src/lib/krb5/ccache/cc_kcm.c
+++ b/src/lib/krb5/ccache/cc_kcm.c
@@ -966,6 +966,9 @@ kcm_ptcursor_next(krb5_context context, krb5_cc_ptcursor cursor,
kcmreq_init(&req, KCM_OP_GET_CACHE_BY_UUID, NULL);
k5_buf_add_len(&req.reqbuf, id, KCM_UUID_LEN);
ret = kcmio_call(context, data->io, &req);
+ /* Continue if the cache has been deleted. */
+ if (ret == KRB5_CC_END)
+ continue;
if (ret)
goto cleanup;
ret = kcmreq_get_name(&req, &name);