To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.admin.generalOpen lugnet.admin.general in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Administrative / General / 4021
4020  |  4022
Subject: 
Re: Y2K problem with lugnet! (was Re: Help! My newsreader's downloading everything on lugnet!)
Newsgroups: 
lugnet.admin.general
Date: 
Sun, 2 Jan 2000 02:58:29 GMT
Viewed: 
976 times
  
In lugnet.admin.general, lehman@javanet.com (Todd Lehman) writes:
Update:  Well, that fixes the NEWGROUPS command all right, but the NEWNEWS
command is doing something more insidious afterwards with date strings.

OK, the other thing the NEWNEWS command was doing was comparing 12-character
date strings (for example, "991231235959" is the last second of 1999) as
generated by a function ltod() which called sprintf with values obtained via
gmtime(), which is OK, but the sprintf used %02d's, resulting in the first
second of 2000 coming out as "1000101000000" (i.e., the year is 100 instead
of 2000 or 00).  The string comparison is left-justified, so they compared
like this:

   "991231235959"   (1999 Dec 31 23:59:59)
   "1000101000000"  (2000 Jan 01 00:00:00)

I changed a block of code inside of ltod() of date.c from:

   (void) sprintf(timebuf, "%02d%02d%02d%02d%02d%02d",
                  tp->tm_year,
                  tp->tm_mon + 1,         /* 0 to 11??? How silly. */
                  tp->tm_mday,
                  tp->tm_hour,
                  tp->tm_min,
                  tp->tm_sec);

to:

   (void) sprintf(timebuf, "%04d%02d%02d%02d%02d%02d",
                            ^^^^
                  tp->tm_year + 1900,   /* Y2K bug workaround */
                              ^^^^^^
                  tp->tm_mon + 1,         /* 0 to 11??? How silly. */
                  tp->tm_mday,
                  tp->tm_hour,
                  tp->tm_min,
                  tp->tm_sec);

Now ltod() returns:

   "19991231235959"  (1999 Dec 31 23:59:59)
   "20000101000000"  (2000 Jan 01 00:00:00)

and the comparisons work.

The rilly goofy thing is that the NEWNEWS command takes epoch-time values,
converts them to strings with ltod(), and then has a custom string
comparison function to compare those.  It's really goofy.  At least it's in
C and it's still extremely fast, even if it's stupid.  Probably the reason
it doesn't compare the integer epoch times directly is because the code was
originally written for the B-News history file format, which went like this:

   "12/31/99 23:59"  (1999 Dec 31 23:59)

and a custom comparison routine wouldn't be odd for that, if that was the
native representation at some broken point in time long ago.

Anyway, I recompiled, unit tested, and then put a new nntpd up on port 1119
(just that port, not the others yet).

Gonna do some more regression testing via

   news://lugnet.com:1119/lugnet.loc.uk

and some other ways I can think of, then I'll make new fixed versions for
the other ports and put those up too.

This'll fix the problem Tony Priestman discovered, but there still may be
other problems lurking around.  I'm pretty surprised actually that even
CNews had a Y2K bug.  I guess CNews is just *so* old (it goes back to the
1980's, I think), and the NNTP protocol itself is broken, as MattM pointed
out.

--Todd



Message has 3 Replies:
  Re: Y2K problem with lugnet! (was Re: Help! My newsreader's downloading everything on lugnet!)
 
(...) :) Good job; and thanks. (25 years ago, 2-Jan-00, to lugnet.admin.general)
  Re: Y2K problem with lugnet! (was Re: Help! My newsreader's downloading everything on lugnet!)
 
(...) The NNTP protocol is _not_ Y2K broken going by the quoted bit of RFC, though. Assuming Epoch for NNTP is the reasonable assumption, and the RFC specifies what to do with that assumption - so NNTP isn't broken for another 70 years (By which (...) (25 years ago, 2-Jan-00, to lugnet.admin.general)
  Re: Y2K problem with lugnet! (was Re: Help! My newsreader's downloading everything on lugnet!)
 
(...) Awrighty, I just installed the new nntpd on the other 3 ports. Now all four ports of 119, 1119, 8000, and 8080 have the new nntpd. Tony, has the problem now vanished? --Todd [cc'ing a copy to Tony via email] (25 years ago, 3-Jan-00, to lugnet.admin.general)

Message is in Reply To:
  Re: Y2K problem with lugnet! (was Re: Help! My newsreader's downloading everything on lugnet!)
 
(...) Update: Well, that fixes the NEWGROUPS command all right, but the NEWNEWS command is doing something more insidious afterwards with date strings. Still digging...old nntpd is still in place. Oddly, the NNTP Reference Implementation distro (...) (25 years ago, 2-Jan-00, to lugnet.admin.general)

40 Messages in This Thread:












Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR