[30144] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Continue after KRB5_CC_END in KCM cache iteration

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Mar 28 17:55:04 2018

Date: Wed, 28 Mar 2018 17:54:57 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201803282154.w2SLsvRA013226@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
Content-Type: multipart/mixed; boundary="===============3175713684012460957=="
Errors-To: cvs-krb5-bounces@mit.edu

--===============3175713684012460957==

https://github.com/krb5/krb5/commit/49087f5e6309f298f8898c35af6f4ade418ced60
commit 49087f5e6309f298f8898c35af6f4ade418ced60
Author: Fabiano FidĂȘncio <fidencio@redhat.com>
Date:   Wed Mar 28 18:27:06 2018 +0200

    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]
    
    ticket: 8658 (new)
    tags: pullup
    target_version: 1.16-next
    target_version: 1.15-next

 src/lib/krb5/ccache/cc_kcm.c |    3 +++
 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 b621ed3..0d38b18 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);

--===============3175713684012460957==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

--===============3175713684012460957==--

home help back first fref pref prev next nref lref last post