print tokens even if there isn't v4 support

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@12245 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2003-05-08 18:43:22 +00:00
parent 0486260adf
commit d7e8189ab7

View File

@@ -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.
*
@@ -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;
}