Use unparse_flags for ticket flags.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23830 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-09-14 11:53:28 +00:00
parent b852960c8a
commit 18e444d6d4

View File

@@ -33,6 +33,7 @@
#include "kuser_locl.h" #include "kuser_locl.h"
#include "rtbl.h" #include "rtbl.h"
#include "parse_units.h"
RCSID("$Id$"); RCSID("$Id$");
@@ -123,7 +124,6 @@ print_cred_verbose(krb5_context context, krb5_creds *cred)
int j; int j;
char *str; char *str;
krb5_error_code ret; krb5_error_code ret;
int first_flag;
krb5_timestamp sec; krb5_timestamp sec;
krb5_timeofday (context, &sec); krb5_timeofday (context, &sec);
@@ -175,33 +175,21 @@ print_cred_verbose(krb5_context context, krb5_creds *cred)
if(cred->times.authtime != cred->times.starttime) if(cred->times.authtime != cred->times.starttime)
printf(N_("Start time: %s\n", ""), printf(N_("Start time: %s\n", ""),
printable_time_long(cred->times.starttime)); printable_time_long(cred->times.starttime));
printf(N_("End time: %s", "") printf(N_("End time: %s", ""),
printable_time_long(cred->times.endtime)); printable_time_long(cred->times.endtime));
if(sec > cred->times.endtime) if(sec > cred->times.endtime)
printf(N_(" (expired)", "")); printf(N_(" (expired)", ""));
printf("\n"); printf("\n");
if(cred->flags.b.renewable) if(cred->flags.b.renewable)
printf(N_("Renew till: %s\n", ""), printf(N_("Renew till: %s\n", ""),
printable_time_long(cred->times.renew_till)); printable_time_long(cred->times.renew_till));
printf(N_("Ticket flags: ", "")); {
#define PRINT_FLAG2(f, s) if(cred->flags.b.f) { if(!first_flag) printf(", "); printf("%s", #s); first_flag = 0; } char flags[1024];
#define PRINT_FLAG(f) PRINT_FLAG2(f, f) unparse_flags(TicketFlags2int(cred->flags.b),
first_flag = 1; asn1_TicketFlags_units(),
PRINT_FLAG(forwardable); flags, sizeof(flags));
PRINT_FLAG(forwarded); printf(N_("Ticket flags: %s\n", ""), flags);
PRINT_FLAG(proxiable); }
PRINT_FLAG(proxy);
PRINT_FLAG2(may_postdate, may-postdate);
PRINT_FLAG(postdated);
PRINT_FLAG(invalid);
PRINT_FLAG(renewable);
PRINT_FLAG(initial);
PRINT_FLAG2(pre_authent, pre-authenticated);
PRINT_FLAG2(hw_authent, hw-authenticated);
PRINT_FLAG2(transited_policy_checked, transited-policy-checked);
PRINT_FLAG2(ok_as_delegate, ok-as-delegate);
PRINT_FLAG(anonymous);
printf("\n");
printf(N_("Addresses: ", "")); printf(N_("Addresses: ", ""));
if (cred->addresses.len != 0) { if (cred->addresses.len != 0) {
for(j = 0; j < cred->addresses.len; j++){ for(j = 0; j < cred->addresses.len; j++){