From dee03d9beec8da40e429e99fc9a7383b2b2574be Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Mon, 13 Apr 2015 18:43:15 -0500 Subject: [PATCH] Rename cred handle lifetime to endtime And change type from OM_uint32 to time_t. --- lib/gssapi/krb5/acquire_cred.c | 7 ++----- lib/gssapi/krb5/add_cred.c | 2 +- lib/gssapi/krb5/copy_ccache.c | 6 +----- lib/gssapi/krb5/gsskrb5_locl.h | 2 +- lib/gssapi/krb5/inquire_cred.c | 2 +- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/lib/gssapi/krb5/acquire_cred.c b/lib/gssapi/krb5/acquire_cred.c index c340f9482..fdefc47d0 100644 --- a/lib/gssapi/krb5/acquire_cred.c +++ b/lib/gssapi/krb5/acquire_cred.c @@ -100,6 +100,7 @@ static OM_uint32 acquire_initiator_cred krb5_error_code kret; int try_get_init_creds = 0; time_t now; + OM_uint32 left; keytab = NULL; ccache = NULL; @@ -218,11 +219,7 @@ found: krb5_cc_close(context, ccache); goto end; } - /* - * XXX: This is persistent state, and needs to be absolute not - * relative time, and so the field name is wrong! - */ - handle->lifetime = now + left; + handle->endtime = now + left; handle->ccache = ccache; ret = GSS_S_COMPLETE; kret = 0; diff --git a/lib/gssapi/krb5/add_cred.c b/lib/gssapi/krb5/add_cred.c index 2980bf6de..1d498c157 100644 --- a/lib/gssapi/krb5/add_cred.c +++ b/lib/gssapi/krb5/add_cred.c @@ -134,7 +134,7 @@ OM_uint32 GSSAPI_CALLCONV _gsskrb5_add_cred ( } handle->usage = cred_usage; - handle->lifetime = cred->lifetime; + handle->endtime = cred->endtime; handle->principal = NULL; handle->keytab = NULL; handle->ccache = NULL; diff --git a/lib/gssapi/krb5/copy_ccache.c b/lib/gssapi/krb5/copy_ccache.c index 611b95ae9..14296bccd 100644 --- a/lib/gssapi/krb5/copy_ccache.c +++ b/lib/gssapi/krb5/copy_ccache.c @@ -129,11 +129,7 @@ _gsskrb5_krb5_import_cred(OM_uint32 *minor_status, free(handle); return ret; } - /* - * XXX: This is a stored value, hence an absolute time, and the field - * name is misleading. - */ - handle->lifetime = now + left; + handle->endtime = now + left; kret = krb5_cc_get_full_name(context, id, &str); if (kret) diff --git a/lib/gssapi/krb5/gsskrb5_locl.h b/lib/gssapi/krb5/gsskrb5_locl.h index 4a4f445a7..451a915c5 100644 --- a/lib/gssapi/krb5/gsskrb5_locl.h +++ b/lib/gssapi/krb5/gsskrb5_locl.h @@ -95,7 +95,7 @@ typedef struct { #define GSS_CF_DESTROY_CRED_ON_RELEASE 1 #define GSS_CF_NO_CI_FLAGS 2 struct krb5_keytab_data *keytab; - OM_uint32 lifetime; + time_t endtime; gss_cred_usage_t usage; gss_OID_set mechanisms; struct krb5_ccache_data *ccache; diff --git a/lib/gssapi/krb5/inquire_cred.c b/lib/gssapi/krb5/inquire_cred.c index 93d165343..1770fec76 100644 --- a/lib/gssapi/krb5/inquire_cred.c +++ b/lib/gssapi/krb5/inquire_cred.c @@ -198,7 +198,7 @@ OM_uint32 GSSAPI_CALLCONV _gsskrb5_inquire_cred if (lifetime != NULL) { ret = _gsskrb5_lifetime_left(minor_status, context, - cred->lifetime, + cred->endtime, lifetime); if (ret) goto out; -- 2.11.4.GIT