[1765] in Kerberos-V5-bugs
Re: KRB5b4.3 & Dec 31
daemon@ATHENA.MIT.EDU (John Hawkinson)
Sun Dec 31 19:35:07 1995
Date: Sun, 31 Dec 1995 19:34:56 -0500
To: ph-maint@uiuc.edu, mhbraun@MIT.EDU
Cc: krb5-bugs@MIT.EDU
From: John Hawkinson <jhawk@MIT.EDU>
Craig Leres of LBL points out the attached.
----------------------------
revision 5.3
date: 1995/02/03 19:34:56; author: tytso; state: Exp; lines: +1 -1
Don't double count the leap day in a leap year.
----------------------------
--jhawk
[6416] daemon@ATHENA.MIT.EDU (Craig Leres) Kerberos 12/31/95 19:27 (67 lines)
Subject: kerberos 5 beta 4 leap year bugaboo (fixed in beta 5)
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;
--[6416]--