don't whine when principal is not found in cache, also, use krb5_cc function to make it not hit the network
This commit is contained in:
@@ -40,7 +40,7 @@ __gsskrb5_ccache_lifetime(OM_uint32 *minor_status,
|
|||||||
krb5_principal principal,
|
krb5_principal principal,
|
||||||
OM_uint32 *lifetime)
|
OM_uint32 *lifetime)
|
||||||
{
|
{
|
||||||
krb5_creds in_cred, *out_cred;
|
krb5_creds in_cred, out_cred;
|
||||||
krb5_const_realm realm;
|
krb5_const_realm realm;
|
||||||
krb5_error_code kret;
|
krb5_error_code kret;
|
||||||
|
|
||||||
@@ -61,16 +61,16 @@ __gsskrb5_ccache_lifetime(OM_uint32 *minor_status,
|
|||||||
return GSS_S_FAILURE;
|
return GSS_S_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
kret = krb5_get_credentials(context, 0,
|
kret = krb5_cc_retrieve_cred(context, id, 0, &in_cred, &out_cred);
|
||||||
id, &in_cred, &out_cred);
|
|
||||||
krb5_free_principal(context, in_cred.server);
|
krb5_free_principal(context, in_cred.server);
|
||||||
if (kret) {
|
if (kret) {
|
||||||
*minor_status = kret;
|
*minor_status = 0;
|
||||||
return GSS_S_FAILURE;
|
*lifetime = 0;
|
||||||
|
return GSS_S_COMPLETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
*lifetime = out_cred->times.endtime;
|
*lifetime = out_cred.times.endtime;
|
||||||
krb5_free_creds(context, out_cred);
|
krb5_free_cred_contents(context, &out_cred);
|
||||||
|
|
||||||
return GSS_S_COMPLETE;
|
return GSS_S_COMPLETE;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user