summaryrefslogtreecommitdiff
path: root/source4/heimdal/lib/gssapi/krb5/acquire_cred.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-08-30 07:38:02 +1000
committerAndrew Tridgell <tridge@samba.org>2008-08-30 07:38:02 +1000
commite82f2187325274d728ec7470990f971e7b3db13c (patch)
tree25ce940a5b2a57c6191265664fad0e70aee951fa /source4/heimdal/lib/gssapi/krb5/acquire_cred.c
parent9817f3d785ceb67819a9def0e8030272e4ba9e14 (diff)
parent81dcc99e9acb9a7e4c2358e5e44998e4718dc658 (diff)
downloadsamba-e82f2187325274d728ec7470990f971e7b3db13c.tar.gz
samba-e82f2187325274d728ec7470990f971e7b3db13c.tar.bz2
samba-e82f2187325274d728ec7470990f971e7b3db13c.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit f008c3b6ee324056fd9b63f6151ad6849640c959)
Diffstat (limited to 'source4/heimdal/lib/gssapi/krb5/acquire_cred.c')
-rw-r--r--source4/heimdal/lib/gssapi/krb5/acquire_cred.c20
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) {