diff options
author | Andrew Bartlett <abartlet@samba.org> | 2005-10-25 13:43:37 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:45:15 -0500 |
commit | 4019064c5d866015a0d78b32dd051ec1dacf8ebf (patch) | |
tree | f904d6178cd36f357e969c40ea2336d1ebcbb22e /source4/heimdal/lib/gssapi/acquire_cred.c | |
parent | d27ffc27ffd5ab57b5e0124203a08a3bb70aa1e1 (diff) | |
download | samba-4019064c5d866015a0d78b32dd051ec1dacf8ebf.tar.gz samba-4019064c5d866015a0d78b32dd051ec1dacf8ebf.tar.bz2 samba-4019064c5d866015a0d78b32dd051ec1dacf8ebf.zip |
r11294: Update Heimdal in Samba4 to lorikeet-heimdal (which is in turn updated
to CVS of 2005-10-24).
Andrew Bartlett
(This used to be commit 939d4f340feaad15d0a6a5da79feba2b2558f174)
Diffstat (limited to 'source4/heimdal/lib/gssapi/acquire_cred.c')
-rw-r--r-- | source4/heimdal/lib/gssapi/acquire_cred.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source4/heimdal/lib/gssapi/acquire_cred.c b/source4/heimdal/lib/gssapi/acquire_cred.c index 6ded413626..23c2603352 100644 --- a/source4/heimdal/lib/gssapi/acquire_cred.c +++ b/source4/heimdal/lib/gssapi/acquire_cred.c @@ -33,7 +33,7 @@ #include "gssapi_locl.h" -RCSID("$Id: acquire_cred.c,v 1.22 2005/01/05 02:32:26 lukeh Exp $"); +RCSID("$Id: acquire_cred.c,v 1.23 2005/10/21 12:44:08 lha Exp $"); static krb5_error_code get_keytab(krb5_context context, krb5_keytab *keytab) @@ -83,9 +83,23 @@ static OM_uint32 acquire_initiator_cred ret = GSS_S_FAILURE; memset(&cred, 0, sizeof(cred)); + /* If we have a preferred principal, lets try to find it in all + * caches, otherwise, fall back to default cache. Ignore + * errors. */ + if (ccache == NULL && handle->principal) { + kret = krb5_cc_cache_match (gssapi_krb5_context, + handle->principal, + NULL, + &ccache); + if (kret) { + ccache = NULL; + } else { + made_ccache = TRUE; + } + } if (ccache == NULL) { - kret = krb5_cc_default(context, &ccache); - if (kret) + kret = krb5_cc_default(gssapi_krb5_context, &ccache); + if (kret) goto end; made_ccache = TRUE; } |