]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Continue on KRB5_FCC_NOFILE in KCM cache iteration 1136/head
authorGreg Hudson <ghudson@mit.edu>
Sat, 21 Nov 2020 06:41:41 +0000 (01:41 -0500)
committerGreg Hudson <ghudson@mit.edu>
Fri, 8 Jan 2021 05:03:46 +0000 (00:03 -0500)
Although Heimdal's KCM client only continues after KRB5_CC_END,
Heimdal's and macOS's KCM server returns KRB5_FCC_NOFILE if a cache
uuid no longer exists.  Check for both errors during iteration.  Also
set ret to 0 when continuing, in case the skipped uuid is the last one
in the list.

ticket: 8967 (new)
tags: pullup
target_version: 1.19

src/lib/krb5/ccache/cc_kcm.c

index a76a285d91863a571b362497c9b4ccaa97199e30..9093f894d12f18aff05d06cc1bf6e1f828231b34 100644 (file)
@@ -981,8 +981,10 @@ kcm_ptcursor_next(krb5_context context, krb5_cc_ptcursor cursor,
         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)
+        if (ret == KRB5_CC_END || ret == KRB5_FCC_NOFILE) {
+            ret = 0;
             continue;
+        }
         if (ret)
             goto cleanup;
         ret = kcmreq_get_name(&req, &name);