From 6a264aecc07c63e3edd016979183f895353f75ab Mon Sep 17 00:00:00 2001 From: Sam Hartman Date: Fri, 10 Jan 2003 01:23:49 +0000 Subject: [PATCH] Patch to get new service tickets in preference to using expired service tickets in krb5_get_credentials. Ticket: 1260 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15106 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 8 ++++++++ src/lib/krb5/krb/get_creds.c | 8 +++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 826cdc08f..452950b8d 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,11 @@ +2003-01-09 Sam Hartman + + * get_creds.c (krb5_get_credentials_core): Patch from Ben Cox + to not use expired service credentials if + the endtime is null but instead to search for unexpired + credentials. If none are found, get new credentials. + + 2003-01-08 Sam Hartman * fwd_tgt.c (krb5_fwd_tgt_creds): Don't require hostname to be supplied unless you are using addresses in the ticket. diff --git a/src/lib/krb5/krb/get_creds.c b/src/lib/krb5/krb/get_creds.c index 934971076..cb6d8b1e3 100644 --- a/src/lib/krb5/krb/get_creds.c +++ b/src/lib/krb5/krb/get_creds.c @@ -55,7 +55,13 @@ krb5_get_credentials_core(krb5_context context, krb5_flags options, memset((char *)mcreds, 0, sizeof(krb5_creds)); mcreds->magic = KV5M_CREDS; - mcreds->times.endtime = in_creds->times.endtime; + if (in_creds->times.endtime != 0) { + mcreds->times.endtime = in_creds->times.endtime; + } else { + krb5_error_code retval; + retval = krb5_timeofday(context, &mcreds->times.endtime); + if (retval != 0) return retval; + } #ifdef HAVE_C_STRUCTURE_ASSIGNMENT mcreds->keyblock = in_creds->keyblock; #else -- 2.26.2