diff options
author | Andrew Bartlett <abartlet@samba.org> | 2008-08-27 11:01:55 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2008-08-27 11:01:55 +1000 |
commit | 8b94f7bcd70b1196487b433e355127a4f84bf5a5 (patch) | |
tree | 940c1838cd0fa4033fef7945e97b530341f99ecf /source4/heimdal/lib/gssapi/krb5/acquire_cred.c | |
parent | ca20c56b260e2799c40b0c7c0e3ef5f7308b586e (diff) | |
parent | 9430420ba246c26489ad51e8b52e13d891436bb3 (diff) | |
download | samba-8b94f7bcd70b1196487b433e355127a4f84bf5a5.tar.gz samba-8b94f7bcd70b1196487b433e355127a4f84bf5a5.tar.bz2 samba-8b94f7bcd70b1196487b433e355127a4f84bf5a5.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into pac-verify
(This used to be commit 32143287c7eb452c6ed9ccd15e8cd4e5a907b437)
Diffstat (limited to 'source4/heimdal/lib/gssapi/krb5/acquire_cred.c')
-rw-r--r-- | source4/heimdal/lib/gssapi/krb5/acquire_cred.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source4/heimdal/lib/gssapi/krb5/acquire_cred.c b/source4/heimdal/lib/gssapi/krb5/acquire_cred.c index 051446c19b..a7caf1a32e 100644 --- a/source4/heimdal/lib/gssapi/krb5/acquire_cred.c +++ b/source4/heimdal/lib/gssapi/krb5/acquire_cred.c @@ -33,7 +33,7 @@ #include "krb5/gsskrb5_locl.h" -RCSID("$Id: acquire_cred.c 22596 2008-02-18 18:05:55Z lha $"); +RCSID("$Id$"); OM_uint32 __gsskrb5_ccache_lifetime(OM_uint32 *minor_status, @@ -134,11 +134,16 @@ static OM_uint32 acquire_initiator_cred * errors while searching. */ - if (handle->principal) + if (handle->principal) { kret = krb5_cc_cache_match (context, handle->principal, NULL, &ccache); + if (kret == 0) { + ret = GSS_S_COMPLETE; + goto found; + } + } if (ccache == NULL) { kret = krb5_cc_default(context, &ccache); @@ -211,7 +216,7 @@ static OM_uint32 acquire_initiator_cred } kret = 0; } - + found: handle->ccache = ccache; ret = GSS_S_COMPLETE; @@ -242,7 +247,6 @@ static OM_uint32 acquire_acceptor_cred OM_uint32 ret; krb5_error_code kret; - kret = 0; ret = GSS_S_FAILURE; kret = get_keytab(context, &handle->keytab); if (kret) @@ -336,13 +340,13 @@ OM_uint32 _gsskrb5_acquire_cred HEIMDAL_MUTEX_init(&handle->cred_id_mutex); if (desired_name != GSS_C_NO_NAME) { - krb5_principal name = (krb5_principal)desired_name; - ret = krb5_copy_principal(context, name, &handle->principal); + + ret = _gsskrb5_canon_name(minor_status, context, 0, desired_name, + &handle->principal); if (ret) { HEIMDAL_MUTEX_destroy(&handle->cred_id_mutex); - *minor_status = ret; free(handle); - return GSS_S_FAILURE; + return ret; } } if (cred_usage == GSS_C_INITIATE || cred_usage == GSS_C_BOTH) { |