Elm has a Y2K problem in determining whether a message has expired. There are actually two bugs. Years after 2000 are considered as 1900. A second bug causes nothing to be considered expired in 2000. But everything will be considered expired after 2001 since the expiration date will be assumed to be in 1901. Here is patch which fixes the problem. --- expires.c.old Fri Sep 29 12:42:07 1995 +++ expires.c Sat Jan 1 09:31:32 2000 @@ -46,6 +46,7 @@ time_t thetime; char word1[WLEN], word2[WLEN], word3[WLEN], word4[WLEN], word5[WLEN]; int month = 0, day = 0, year = 0, hour = 0, minute = 0, items; + int bad_year = FALSE; #ifndef _POSIX_SOURCE struct tm *localtime(); time_t time(); @@ -87,6 +88,7 @@ day = atoi(word1); month = month_number(word2); year = atoi(word3); + bad_year = !isdigit( *word4); sscanf(word4, "%02d%*c%02d", &hour, &minute); } @@ -100,25 +102,35 @@ month = month_number(word3); day = atoi(word2); year = atoi(word4); + bad_year = !isdigit( *word4); } else { /* form #1 */ month = month_number(word2); day = atoi(word3); year = atoi(word4); + bad_year = !isdigit( *word4); } } else if (! isdigit(word1[0])) { /* form #3 */ month = month_number(word1); day = atoi(word2); year = atoi(word3); + bad_year = !isdigit( *word3); } else { /* form #4 */ day = atoi(word1); month = month_number(word2); year = atoi(word3); + bad_year = !isdigit( *word3); } - if (day == 0 || year == 0) + if (day == 0 || bad_year) return; /* we didn't get a valid date */ + + if ( year < 69) + year += 100; + + if ( year >= 1900) + year -= 1900; /** next let's get the current time and date, please **/ --- date.c.old Mon Apr 5 08:03:12 1999 +++ date.c Sat Jan 1 09:31:24 2000 @@ -98,7 +98,7 @@ /* now, finally, build the actual date string */ the_time->tm_mday %= 32, - strftime(buffer, SLEN, "%a, %d %B %y", the_time); + strftime(buffer, SLEN, "%a, %d %B %Y", the_time); }
Created attachment 48 [details] patch to fixe elm Y2K bug
There is an error in the patch listed in the report and in the attached file. Where the lines year = atoi(word3); + bad_year = !isdigit( *word4); first occur (the first occurrence of !isdigit) the "*word4" should be changed to "*word3" so the lines become year = atoi(word3); + bad_year = !isdigit( *word3);
Fixed in elm-2.5.2-1. Thanks for the patch.
*** Bug 10908 has been marked as a duplicate of this bug. ***