From: Alexandra Ellwood Date: Wed, 19 Jul 2006 02:28:24 +0000 (+0000) Subject: acquire_cred(): Realized that my previous patch now basically favors the X-Git-Tag: krb5-1.6-alpha1~200 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=263528772958edf1a7987dce0fe974227a9fd5ce;p=krb5.git acquire_cred(): Realized that my previous patch now basically favors the ccache over the desired name. Added a KLL function to search for the desired name, favoring the default ccache. ticket: 4024 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18341 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c index 982504cfc..65ba976c7 100644 --- a/src/lib/gssapi/krb5/acquire_cred.c +++ b/src/lib/gssapi/krb5/acquire_cred.c @@ -234,18 +234,18 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred) if (desired_name != NULL) { #if defined(USE_LOGIN_LIBRARY) KLStatus err = klNoErr; - char *ccache_name = NULL; KLPrincipal kl_desired_princ = NULL; + char *default_name = krb5_cc_default_name (context); + char *ccache_name = NULL; err = __KLCreatePrincipalFromKerberos5Principal ((krb5_principal) desired_name, &kl_desired_princ); if (!err) { - char *default_name = krb5_cc_default_name (context); - if (default_name) { - err = __KLAcquireInitialTicketsForCache (default_name, kl_desired_princ, - NULL, NULL, &ccache_name); + err = __KLAcquireInitialTicketsForCacheAndPrincipal (default_name, kerberosVersion_V5, + kl_desired_princ, NULL, NULL, + &ccache_name); } else { err = KLAcquireInitialTickets (kl_desired_princ, NULL, NULL, &ccache_name); } @@ -260,8 +260,8 @@ acquire_init_cred(context, minor_status, desired_name, output_princ, cred) return(GSS_S_CRED_UNAVAIL); } - if (kl_desired_princ != NULL) { KLDisposePrincipal (kl_desired_princ); } if (ccache_name != NULL) { KLDisposeString (ccache_name); } + if (kl_desired_princ != NULL) { KLDisposePrincipal (kl_desired_princ); } #elif defined(USE_LEASH) if ( hLeashDLL == INVALID_HANDLE_VALUE ) {