Y2K-Bug in INN 1.x, 2.x

Per Hedeland per at erix.ericsson.se
Tue Jan 4 21:25:13 UTC 2000


Bettina Fink <laura at krell.snafu.de> wrote:
>there's a bug in INN 1.x and 2.x (tested with a heavily patched
>1.5.1 and a "normal" 2.2.2):
>
>INN is accepting and propagating articles with Date header "1900"
>(e.g. "Date: 01 Jan 1900 03:00:00 GMT").
>
>It should reject it with 'too old' or 'Can't parse "Date" header'.

This patch, when applied to parsedate.y from INN-2.2 or later (where
only the first chunk "fits", the other two are already effectively in
place...) breaks (some) handling of dates with two-digit years - I guess
00 gets treated as 1900 rather than 2000, which it does with the
original parsedate.y:

Jan  3 22:54:07 news rnews: rejected 437 Bad "Date" header -- "3 Jan 00 21:48:34 GMT"

Of course some may argue that this is a Good Thing (I don't, and have
consequently backed out the patch for the time being), but in any case
it might be interesting to know. Of course it did have the positive
effect that I found that my 'mail2news' (from 'newsgate') emitted Date
headers with two-digit years (but I don't feed those articles
anywhere:-), at the cost of throwing away 180 legitimate mailing list
messages while not finding a single actual-year-1900 article...:-)

The trivial patch for newsgate is below in case anyone cares (yes, it
*stripped out* the century:-) - newsgate obviously isn't maintained
anymore, but the tarball still sits at ftp.isc.org... (and I like it:-).

--Per Hedeland
per at erix.ericsson.se


--- rfc822.c.ORIG	Wed Feb  3 15:14:12 1993
+++ rfc822.c	Tue Jan  4 19:48:38 2000
@@ -314,8 +314,8 @@
     /* "Sep " */
     p = &ud[4]; *q++ = *p++; *q++ = *p++; *q++ = *p++; *q++ = ' ';
 
-    /* "79 " */
-    p = &ud[22]; *q++ = *p++; *q++ = *p++; *q++ = ' ';
+    /* "1979 " */
+    p = &ud[20]; *q++ = *p++; *q++ = *p++; *q++ = *p++; *q++ = *p++; *q++ = ' ';
 
     /* "01:03:52" */
     for (p = &ud[11], i = 8; i > 0; i--)



More information about the inn-workers mailing list