[1612] in Kerberos_V5_Development
Re: modprinc -expire broken?
daemon@ATHENA.MIT.EDU (Barry Jaspan)
Mon Aug 19 12:09:57 1996
Date: Mon, 19 Aug 1996 12:09:50 -0400
From: "Barry Jaspan" <bjaspan@MIT.EDU>
To: hartmans@MIT.EDU
Cc: krbcore@MIT.EDU
Well, I just flipped through the code somewhat, and found
if (Year < EPOCH || Year > 1999
|| Month < 1 || Month > 12
|| Day < 1 || Day > DaysInMonth[(int)--Month])
return -1;
It just removed the (Year > 1999) test, and fixed a 1900-specific leap
year test below it, and for the first few obvious test dates it seems
to be working (I used the test main() built into getdate.y, which
parses a date and then prints out ctime() on the result).
% (setenv TZ EST; datetest )
Enter date, or blank line to exit.
> dec 31, 1999
Fri Dec 31 00:00:00 1999
> jan 1, 2000
Sat Jan 1 00:00:00 2000
> feb 28, 2000
Mon Feb 28 00:00:00 2000
> feb 29, 2000
Tue Feb 29 00:00:00 2000
> mar 1, 2000
Wed Mar 1 00:00:00 2000
> jan 1, 2001
Mon Jan 1 00:00:00 2001
> aug 20, 96
Tue Aug 20 00:00:00 1996
> aug 20, 99
Fri Aug 20 00:00:00 1999
> aug 20, 100
Bad format - couldn't convert.
> feb 28, 2001
Wed Feb 28 00:00:00 2001
> feb 29, 2001
Bad format - couldn't convert.
You know, this is one of those rare cases were we could actually
exhaustively test all the possibilities we care about. There are only
so many days before 1970+2^32 seconds, and only a handful of formats
in which getdate will accept date input.
Barry