diff --git a/lib/krb5/acache.c b/lib/krb5/acache.c index 18b460256..2dcf603cd 100644 --- a/lib/krb5/acache.c +++ b/lib/krb5/acache.c @@ -491,12 +491,21 @@ acc_resolve(krb5_context context, krb5_ccache *id, const char *res) error = (*a->context->func->open_ccache)(a->context, res, &a->ccache); if (error == ccNoError) { + cc_time_t offset; error = get_cc_name(a); if (error != ccNoError) { acc_close(context, *id); *id = NULL; return translate_cc_error(context, error); } + + error = (*a->ccache->func->get_kdc_time_offset)(a->ccache, + cc_credentials_v5, + &offset); + if (error == 0) + context->kdc_sec_offset = offset; + + error = 0; } else if (error == ccErrCCacheNotFound) { a->ccache = NULL; a->cache_name = NULL; @@ -572,6 +581,11 @@ acc_initialize(krb5_context context, name); } + if (error == 0 && context->kdc_sec_offset) + error = (*a->ccache->func->set_kdc_time_offset)(a->ccache, + cc_credentials_v5, + context->kdc_sec_offset); + return translate_cc_error(context, error); }