summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/kuser/klist.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-10-09 19:36:20 +0000
committernectar <nectar@FreeBSD.org>2003-10-09 19:36:20 +0000
commit5c90662d441c12cd30c694eb1172d6fea2f8f282 (patch)
treecb08d962a1d1ff9fd191e67849a7057861f42a50 /crypto/heimdal/kuser/klist.c
parent12eb3dee85137da9effa7d2df35e855dd0a3814a (diff)
downloadFreeBSD-src-5c90662d441c12cd30c694eb1172d6fea2f8f282.zip
FreeBSD-src-5c90662d441c12cd30c694eb1172d6fea2f8f282.tar.gz
Vendor import of Heimdal 0.6.
Diffstat (limited to 'crypto/heimdal/kuser/klist.c')
-rw-r--r--crypto/heimdal/kuser/klist.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/crypto/heimdal/kuser/klist.c b/crypto/heimdal/kuser/klist.c
index dbee058..79a1fa4 100644
--- a/crypto/heimdal/kuser/klist.c
+++ b/crypto/heimdal/kuser/klist.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997-2003 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -34,7 +34,7 @@
#include "kuser_locl.h"
#include "rtbl.h"
-RCSID("$Id: klist.c,v 1.67.2.1 2002/10/21 14:31:27 joda Exp $");
+RCSID("$Id: klist.c,v 1.68.2.1 2003/05/08 18:59:56 lha Exp $");
static char*
printable_time(time_t t)
@@ -466,6 +466,7 @@ display_v4_tickets (int do_verbose)
*/
return 0;
}
+#endif /* KRB4 */
/*
* Print a list of all AFS tokens
@@ -500,7 +501,7 @@ display_tokens(int do_verbose)
continue;
if(parms.out_size < sizeof(size_secret_tok))
continue;
- t[parms.out_size] = 0;
+ t[min(parms.out_size,sizeof(t)-1)] = 0;
memcpy(&size_secret_tok, r, sizeof(size_secret_tok));
/* dont bother about the secret token */
r += size_secret_tok + sizeof(size_secret_tok);
@@ -536,7 +537,6 @@ display_tokens(int do_verbose)
putchar('\n');
}
}
-#endif /* KRB4 */
/*
* display the ccache in `cred_cache'
@@ -596,8 +596,8 @@ static int do_verbose = 0;
static int do_test = 0;
#ifdef KRB4
static int do_v4 = 1;
-static int do_tokens = 0;
#endif
+static int do_tokens = 0;
static int do_v5 = 1;
static char *cred_cache;
static int do_flags = 0;
@@ -612,9 +612,9 @@ static struct getargs args[] = {
#ifdef KRB4
{ "v4", '4', arg_flag, &do_v4,
"display v4 tickets", NULL },
+#endif
{ "tokens", 'T', arg_flag, &do_tokens,
"display AFS tokens", NULL },
-#endif
{ "v5", '5', arg_flag, &do_v5,
"display v5 cred cache", NULL},
{ "verbose", 'v', arg_flag, &do_verbose,
@@ -666,20 +666,24 @@ main (int argc, char **argv)
exit_status = display_v5_ccache (cred_cache, do_test,
do_verbose, do_flags);
-#ifdef KRB4
if (!do_test) {
+#ifdef KRB4
if (do_v4) {
if (do_v5)
printf ("\n");
display_v4_tickets (do_verbose);
}
+#endif
if (do_tokens && k_hasafs ()) {
- if (do_v4 || do_v5)
+ if (do_v5)
printf ("\n");
+#ifdef KRB4
+ else if (do_v4)
+ printf ("\n");
+#endif
display_tokens (do_verbose);
}
}
-#endif
return exit_status;
}
OpenPOWER on IntegriCloud