diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 1998-05-18 01:24:56 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 1998-05-18 01:24:56 +0000 |
commit | f784f25727a5ca9d0f0f348b97da45d6d1d8f0b5 (patch) | |
tree | 24da21eee0da4a2acc299414b3fd549da70b8832 /kerberosIV/klist | |
parent | a0be039f2915753cd4e2002bfef219edc71eeec7 (diff) |
update to kth-krb4-980514
Diffstat (limited to 'kerberosIV/klist')
-rw-r--r-- | kerberosIV/klist/Makefile | 6 | ||||
-rw-r--r-- | kerberosIV/klist/klist.c | 27 |
2 files changed, 28 insertions, 5 deletions
diff --git a/kerberosIV/klist/Makefile b/kerberosIV/klist/Makefile index c0e03f4818f..277c2813add 100644 --- a/kerberosIV/klist/Makefile +++ b/kerberosIV/klist/Makefile @@ -1,9 +1,13 @@ # from @(#)Makefile 8.1 (Berkeley) 6/1/93 -# $Id: Makefile,v 1.2 1997/11/28 12:48:48 art Exp $ +# $Id: Makefile,v 1.3 1998/05/18 01:24:53 art Exp $ PROG= klist +SRCS= klist.c +.PATH: ${.CURDIR}/../roken +SRCS+= parse_time.c parse_units.c DPADD= ${LIBKRB} ${LIBDES} LDADD= -lkrb -ldes -lkafs BINDIR= /usr/bin +CFLAGS+= -I${.CURDIR}/../roken .include <bsd.prog.mk> diff --git a/kerberosIV/klist/klist.c b/kerberosIV/klist/klist.c index 0827e2cceca..e2aec4c6b74 100644 --- a/kerberosIV/klist/klist.c +++ b/kerberosIV/klist/klist.c @@ -1,5 +1,5 @@ -/* $OpenBSD: klist.c,v 1.5 1998/02/25 15:51:02 art Exp $ */ -/* $KTH: klist.c,v 1.28 1997/05/26 17:33:50 bg Exp $ */ +/* $OpenBSD: klist.c,v 1.6 1998/05/18 01:24:55 art Exp $ */ +/* $KTH: klist.c,v 1.35 1998/05/01 05:16:33 joda Exp $ */ /* * This source code is no longer held under any constraint of USA @@ -60,6 +60,20 @@ short_date(time_t dp) return (cp); } +/* prints the approximate kdc time differential as something human + readable */ +static void +print_time_diff(void) +{ + int d = abs(krb_get_kdc_time_diff()); + char buf[80]; + + if ((option_verbose && d > 0) || d > 60) { + unparse_time_approx (d, buf, sizeof(buf)); + printf ("Time diff:\t%s\n", buf); + } +} + static void display_tktfile(char *file, int tgt_test, int long_form) { @@ -129,7 +143,9 @@ display_tktfile(char *file, int tgt_test, int long_form) */ if (!tgt_test && long_form) - printf("Principal:\t%s\n\n", krb_unparse_name(&pr)); + printf("Principal:\t%s\n", krb_unparse_name(&pr)); + print_time_diff(); + printf("\n"); while ((k_errno = tf_get_cred(&c)) == KSUCCESS) { if (!tgt_test && long_form && header) { printf("%-15s %-15s %s%s\n", @@ -149,9 +165,12 @@ display_tktfile(char *file, int tgt_test, int long_form) continue; /* not a tgt */ } if (long_form) { + struct timeval tv; + strcpy(buf1, short_date(c.issue_date)); c.issue_date = krb_life_to_time(c.issue_date, c.lifetime); - if (time(0) < (unsigned long) c.issue_date) + krb_kdctimeofday(&tv); + if (option_verbose || tv.tv_sec < (unsigned long) c.issue_date) strcpy(buf2, short_date(c.issue_date)); else strcpy(buf2, ">>> Expired <<<"); |