(acquire_initiator_cred): use krb5_cc_cache_match to find a matching
creditial cache, if that failes, fallback to the default cache. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16205 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -82,9 +82,20 @@ static OM_uint32 acquire_initiator_cred
|
|||||||
ret = GSS_S_FAILURE;
|
ret = GSS_S_FAILURE;
|
||||||
memset(&cred, 0, sizeof(cred));
|
memset(&cred, 0, sizeof(cred));
|
||||||
|
|
||||||
kret = krb5_cc_default(gssapi_krb5_context, &ccache);
|
/* If we have a preferred principal, lets try to find it in all
|
||||||
if (kret)
|
* caches, otherwise, fall back to default cache. Ignore
|
||||||
goto end;
|
* errors. */
|
||||||
|
if (handle->principal)
|
||||||
|
kret = krb5_cc_cache_match (gssapi_krb5_context,
|
||||||
|
handle->principal,
|
||||||
|
NULL,
|
||||||
|
&ccache);
|
||||||
|
|
||||||
|
if (ccache == NULL) {
|
||||||
|
kret = krb5_cc_default(gssapi_krb5_context, &ccache);
|
||||||
|
if (kret)
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
kret = krb5_cc_get_principal(gssapi_krb5_context, ccache,
|
kret = krb5_cc_get_principal(gssapi_krb5_context, ccache,
|
||||||
&def_princ);
|
&def_princ);
|
||||||
if (kret != 0) {
|
if (kret != 0) {
|
||||||
|
@@ -82,9 +82,20 @@ static OM_uint32 acquire_initiator_cred
|
|||||||
ret = GSS_S_FAILURE;
|
ret = GSS_S_FAILURE;
|
||||||
memset(&cred, 0, sizeof(cred));
|
memset(&cred, 0, sizeof(cred));
|
||||||
|
|
||||||
kret = krb5_cc_default(gssapi_krb5_context, &ccache);
|
/* If we have a preferred principal, lets try to find it in all
|
||||||
if (kret)
|
* caches, otherwise, fall back to default cache. Ignore
|
||||||
goto end;
|
* errors. */
|
||||||
|
if (handle->principal)
|
||||||
|
kret = krb5_cc_cache_match (gssapi_krb5_context,
|
||||||
|
handle->principal,
|
||||||
|
NULL,
|
||||||
|
&ccache);
|
||||||
|
|
||||||
|
if (ccache == NULL) {
|
||||||
|
kret = krb5_cc_default(gssapi_krb5_context, &ccache);
|
||||||
|
if (kret)
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
kret = krb5_cc_get_principal(gssapi_krb5_context, ccache,
|
kret = krb5_cc_get_principal(gssapi_krb5_context, ccache,
|
||||||
&def_princ);
|
&def_princ);
|
||||||
if (kret != 0) {
|
if (kret != 0) {
|
||||||
|
Reference in New Issue
Block a user