Change output format.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1083 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-12-04 10:10:25 +00:00
parent 843a46159f
commit 3b3aeb9fb3

View File

@@ -1,8 +1,21 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/time.h>
#include <krb5.h>
char*
stime(time_t t)
{
static char s[128];
strcpy(s, ctime(&t)+ 4);
s[15] = 0;
return s;
}
int
main (int argc, char **argv)
{
@@ -30,7 +43,7 @@ main (int argc, char **argv)
if (err)
abort ();
printf ("Principal: %s\n", str);
printf ("\tPrincipal: %s\n\n", str);
free (str);
err = krb5_cc_start_seq_get (context, ccache, &cursor);
@@ -41,13 +54,13 @@ main (int argc, char **argv)
ccache,
&creds,
&cursor) == 0) {
printf ("%s ", stime(creds.times.authtime));
printf ("%s ", stime(creds.times.endtime));
err = krb5_unparse_name (context, creds.server, &str);
if (err)
abort ();
printf ("%s\t", str);
printf ("%s\n", 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);
if (err)