From 7f41c75dd0cfde2ea400610942b02db29a17669d Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Wed, 15 Oct 1997 20:46:57 +0000 Subject: [PATCH] print year as YYYY iff verbose git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3618 ec53bebd-3082-4978-b11e-865c3cabbd6b --- kuser/klist.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/kuser/klist.c b/kuser/klist.c index ec4f287ee..031e0e039 100644 --- a/kuser/klist.c +++ b/kuser/klist.c @@ -49,6 +49,15 @@ printable_time(time_t t) return s; } +static char* +printable_time_long(time_t t) +{ + static char s[128]; + strcpy(s, ctime(&t)+ 4); + s[20] = 0; + return s; +} + void print_cred(krb5_context context, krb5_creds *cred) { @@ -107,16 +116,16 @@ print_cred_verbose(krb5_context context, krb5_creds *cred) krb5_keytype_to_string(context, cred->session.keytype, &str); printf("Session key: %s\n", str); free(str); - printf("Auth time: %s\n", printable_time(cred->times.authtime)); + printf("Auth time: %s\n", printable_time_long(cred->times.authtime)); if(cred->times.authtime != cred->times.starttime) - printf("Start time: %s\n", printable_time(cred->times.starttime)); - printf("End time: %s", printable_time(cred->times.endtime)); + printf("Start time: %s\n", printable_time_long(cred->times.starttime)); + printf("End time: %s", printable_time_long(cred->times.endtime)); if(sec > cred->times.endtime) printf(" (expired)"); printf("\n"); if(cred->flags.b.renewable) printf("Renew till: %s\n", - printable_time(cred->times.renew_till)); + printable_time_long(cred->times.renew_till)); printf("Ticket flags: "); #define PRINT_FLAG2(f, s) if(cred->flags.b.f) { if(!first_flag) printf(", "); printf("%s", #s); first_flag = 0; } #define PRINT_FLAG(f) PRINT_FLAG2(f, f)