Change output format.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1083 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,8 +1,21 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <krb5.h>
|
#include <krb5.h>
|
||||||
|
|
||||||
|
|
||||||
|
char*
|
||||||
|
stime(time_t t)
|
||||||
|
{
|
||||||
|
static char s[128];
|
||||||
|
strcpy(s, ctime(&t)+ 4);
|
||||||
|
s[15] = 0;
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char **argv)
|
main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
@@ -30,7 +43,7 @@ main (int argc, char **argv)
|
|||||||
if (err)
|
if (err)
|
||||||
abort ();
|
abort ();
|
||||||
|
|
||||||
printf ("Principal: %s\n", str);
|
printf ("\tPrincipal: %s\n\n", str);
|
||||||
free (str);
|
free (str);
|
||||||
|
|
||||||
err = krb5_cc_start_seq_get (context, ccache, &cursor);
|
err = krb5_cc_start_seq_get (context, ccache, &cursor);
|
||||||
@@ -41,13 +54,13 @@ main (int argc, char **argv)
|
|||||||
ccache,
|
ccache,
|
||||||
&creds,
|
&creds,
|
||||||
&cursor) == 0) {
|
&cursor) == 0) {
|
||||||
|
printf ("%s ", stime(creds.times.authtime));
|
||||||
|
printf ("%s ", stime(creds.times.endtime));
|
||||||
err = krb5_unparse_name (context, creds.server, &str);
|
err = krb5_unparse_name (context, creds.server, &str);
|
||||||
if (err)
|
if (err)
|
||||||
abort ();
|
abort ();
|
||||||
printf ("%s\t", str);
|
printf ("%s\n", str);
|
||||||
free (str);
|
free (str);
|
||||||
printf ("%s\t", ctime(&creds.times.authtime));
|
|
||||||
printf ("%s\n", ctime(&creds.times.endtime));
|
|
||||||
}
|
}
|
||||||
err = krb5_cc_end_seq_get (context, ccache, &cursor);
|
err = krb5_cc_end_seq_get (context, ccache, &cursor);
|
||||||
if (err)
|
if (err)
|
||||||
|
Reference in New Issue
Block a user