{
int k_errno;
int kvno, lifetime;
+ long mit_compat; /* MIT Kerberos 5 with Krb4 uses a "long" for issue_date */
if (fd < 0) {
return TKT_FIL_INI;
/* don't try to read a silly amount into ticket->dat */
token->ticketLen > MAXKTCTICKETLEN
|| tf_read((char *)(token->ticket), token->ticketLen) < 1
- || tf_read((char *)&(token->startTime),
- sizeof(token->startTime)) < 1) {
+ || tf_read((char *)&mit_compat, sizeof(mit_compat)) < 1) {
return TKT_FIL_FMT;
}
+ token->startTime = mit_compat;
token->endTime = life_to_time(token->startTime, lifetime);
token->kvno = kvno;
return 0;
off_t start;
int lifetime, kvno;
int count; /* count for write */
+ long mit_compat; /* MIT Kerberos 5 with Krb4 uses a "long" for issue_date */
if (fd < 0) { /* fd is ticket file as set by afs_tf_init */
return TKT_FIL_INI;
if (write(fd, atoken->ticket, count) != count)
goto bad;
/* Issue date */
- if (write(fd, (char *)&atoken->startTime, sizeof(afs_int32))
- != sizeof(afs_int32))
+ mit_compat = atoken->startTime;
+ if (write(fd, (char *)&mit_compat, sizeof(mit_compat))
+ != sizeof(mit_compat))
goto bad;
/* Actually, we should check each write for success */
char *tf_name;
struct ktc_principal client, server;
struct ktc_token token;
+ long mit_compat; /* MIT Kerberos 5 with Krb4 uses a "long" for issue_date */
if ((strlen(realm) >= sizeof(client.cell)))
return KABADNAME;
if (write(fd, (char *)(token.ticket), count) != count)
goto bad;
/* Issue date */
- if (write(fd, (char *)&token.startTime, sizeof(afs_int32))
- != sizeof(afs_int32))
+ mit_compat = token.startTime;
+ if (write(fd, (char *)&mit_compat, sizeof(mit_compat))
+ != sizeof(mit_compat))
goto bad;
close(fd);
return 0;