]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Do not retrieve zero-length creds
authorBen Kaduk <kaduk@mit.edu>
Fri, 31 Aug 2012 21:48:14 +0000 (17:48 -0400)
committerTom Yu <tlyu@mit.edu>
Tue, 11 Sep 2012 21:40:43 +0000 (17:40 -0400)
In the MSLSA cache, if we get back a zero-length ticket, don't
accept it as success; continue on to try and get an acceptable
ticket.

(cherry picked from commit cd58adf4b0f52d0293ec8bf9d7d3e87bd1e6ce3f)

ticket: 7349
version_fixed: 1.10.4
status: resolved

src/lib/krb5/ccache/cc_mslsa.c

index 39d78e78ea2858a10268ac0aa0cd7a6058d9da72..d692b427004bccdf7a04e0f96dc37c6ce9b48156 100644 (file)
@@ -2489,7 +2489,8 @@ krb5_lcc_retrieve(krb5_context context, krb5_ccache id, krb5_flags whichfields,
 
     /* first try to find out if we have an existing ticket which meets the requirements */
     kret = krb5_cc_retrieve_cred_default (context, id, whichfields, mcreds, creds);
-    if ( !kret )
+    /* This sometimes returns a zero-length ticket; work around it. */
+    if ( !kret && creds->ticket.length > 0 )
         return KRB5_OK;
 
     /* if not, we must try to get a ticket without specifying any flags or etypes */
@@ -2506,7 +2507,8 @@ krb5_lcc_retrieve(krb5_context context, krb5_ccache id, krb5_flags whichfields,
 
     /* try again to find out if we have an existing ticket which meets the requirements */
     kret = krb5_cc_retrieve_cred_default (context, id, whichfields, mcreds, creds);
-    if ( !kret )
+    /* This sometimes returns a zero-length ticket; work around it. */
+    if ( !kret && creds->ticket.length > 0 )
         goto cleanup;
 
     /* if not, obtain a ticket using the request flags and enctype even though it may not