mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 07:20:11 +00:00
64bit-ticket-file-20070809
fix the ticket files we write on 64 bit
This commit is contained in:
parent
377689b39a
commit
6811175f37
@ -1166,6 +1166,7 @@ afs_tf_get_cred(principal, token)
|
||||
{
|
||||
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;
|
||||
@ -1202,10 +1203,10 @@ afs_tf_get_cred(principal, token)
|
||||
/* 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;
|
||||
@ -1333,6 +1334,7 @@ afs_tf_save_cred(aserver, atoken, aclient)
|
||||
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;
|
||||
@ -1402,8 +1404,9 @@ afs_tf_save_cred(aserver, atoken, aclient)
|
||||
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 */
|
||||
|
@ -84,6 +84,7 @@ krb_write_ticket_file(realm)
|
||||
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;
|
||||
@ -149,8 +150,9 @@ krb_write_ticket_file(realm)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user