[6416] in Kerberos
kerberos 5 beta 4 leap year bugaboo (fixed in beta 5)
daemon@ATHENA.MIT.EDU (Craig Leres)
Sun Dec 31 19:27:59 1995
To: kerberos@MIT.EDU
Date: 1 Jan 1996 00:15:32 GMT
From: leres@ell.ee.lbl.gov (Craig Leres)
Reply-To: leres@ee.lbl.gov (ucbvax!leres for uucp weenies)
In case anyone else is running beta 4 and getting:
k5init: KDC reply did not match expectations
while getting initial credentials
The problem is in krb5/os/gmt_mktime.c (context diff between my copies
of beta 4 and beta 5 appended). Unfortunately, you must relink at least
krb5kdc and k5init.
Craig
------
RCS file: RCS/gmt_mktime.c,v
retrieving revision 1.2
diff -c -r1.2 gmt_mktime.c
*** /tmp/,RCSt1a24109 Sun Dec 31 15:57:50 1995
--- gmt_mktime.c Sun Dec 31 15:49:32 1995
***************
*** 2,8 ****
--- 2,10 ----
#include <stdio.h>
+ #ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
+ #endif
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#ifdef TIME_WITH_SYS_TIME
***************
*** 38,44 ****
{
time_t accum;
! #define assert_time(cnd) if(!(cnd)) return -1
assert_time(t->tm_year>=70);
assert_time(t->tm_year<=138);
--- 40,46 ----
{
time_t accum;
! #define assert_time(cnd) if(!(cnd)) return (time_t) -1
assert_time(t->tm_year>=70);
assert_time(t->tm_year<=138);
***************
*** 60,66 ****
accum *= 365; /* 365 days/normal year */
/* add in leap day for all previous years */
! accum += (t->tm_year - 68) / 4;
/* add in leap day for this year */
if(t->tm_mon >= 2) /* march or later */
if(hasleapday(t->tm_year)) accum += 1;
--- 62,68 ----
accum *= 365; /* 365 days/normal year */
/* add in leap day for all previous years */
! accum += (t->tm_year - 69) / 4;
/* add in leap day for this year */
if(t->tm_mon >= 2) /* march or later */
if(hasleapday(t->tm_year)) accum += 1;