🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
5 messages
5 total messages Started by CatMega Sun, 11 May 1997 00:00
Year 2000 format for NEWNEWS, NEWGROUPS, etc.
#17695
Author: CatMega
Date: Sun, 11 May 1997 00:00
11 lines
662 bytes
Is it safe to assume that 00 will be valid for the yy portion of
date specifications for the above?


Cheers!
CatMega
http://www.newtoy.com


Year 2000 problems in (at least) INN1.4 unoff 4
#17829
Author: Della Lu
Date: Sat, 17 May 1997 00:00
44 lines
1699 bytes
catmega@MCS.COM (CatMega) writes:
> Is it safe to assume that 00 will be valid for the yy portion of
> date specifications for the above?

Not in INN 1.4 unoff 4 at least. They would need to change NNTPtoGMT
from:
 for (seconds = 0, year += 1900, i = 1970; i < year; i++)
    seconds += DaysInYear(i);

to something like:

 for (seconds = 0, year += year<96?2000:1900, i = 1970; i < year; i++)
    seconds += DaysInYear(i);

Or something fancier if you think INN will last longer than 98 years.

parsedate() will also fail due to a problem with Convert(), 
RelativeMonth() will fail very badly due to the interaction between
that Convert() problem interacting with DSTcorrect().

Convert() should be changed from:

    if (Year < 0)
	Year = -Year;
    if (Year < 100)
	Year += 1900;
    if (Year < EPOCH)
	Year += 100;

to something like:

    if (Year < 0)
      Year = -Year;
    if (Year < 100)
      Year += Year<96?2000:1900;
    if (Year < EPOCH) /* struct tm years */
      Year += 1900;

-- 
Della Lu


Re: Year 2000 format for NEWNEWS, NEWGROUPS, etc.
#17853
Author: Steve Mitchell
Date: Mon, 19 May 1997 00:00
46 lines
2419 bytes

CatMega wrote in article <5l5p7p$gtp$1@Mars.mcs.net>...
>Is it safe to assume that 00 will be valid for the yy portion of
>date specifications for the above?

according to the nntp rfc (rfc 977) the server should use a sliding
window to assume years to the closest century: 

>3.7.1.  NEWGROUPS>   >NEWGROUPS date time [GMT] [<distributions>]>
   >A list of newsgroups created since <date and time> will be listed in
   >the same format as the LIST command.
   >The date is sent as 6 digits in the format YYMMDD, where YY is the
   >last two digits of the year, MM is the two digits of the month (with
   >leading zero, if appropriate), and DD is the day of the month (with
   >leading zero, if appropriate).  The closest century is assumed as
   >part of the year (i.e., 86 specifies 1986, 30 specifies 2030, 99 is
   >1999, 00 is 2000).
but in my tests i have found nntp servers which did not seem to comply.
Example: asking for newnews 00<today> gave me *all* articles
rather than zero articles as it should.

this is a classic example of a y2k bug that the pointy hair types will
claim is "a non issue" but is actually a problem that needs to be tested
for..

it should be a fairly simple fix to the server.  i have not
looked at the code but i would also be concerned with things like 
article expiration..

does anybody know if article expiration is a problem with the common
nntp servers post y2k?

what has me concerned is the fact that both microsoft and netscape
are putting a lot of wood behind 'workgroup collaboration' based
on nntp.  i have nightmares of people installing non-y2k ready servers
now (without source code!) and then watching them break in 2.5 years..

--steve






Re: Year 2000 format for NEWNEWS, NEWGROUPS, etc.
#17857
Author: Paul Colquhoun
Date: Tue, 20 May 1997 00:00
48 lines
2812 bytes
In article <5lqfkv$jj6$1@news5.snfc21.pacbell.net>, "Steve Mitchell" <steve@tel.jpl.nasa.gov> wrote:

|CatMega wrote in article <5l5p7p$gtp$1@Mars.mcs.net>...
|>Is it safe to assume that 00 will be valid for the yy portion of
|>date specifications for the above?
|
|according to the nntp rfc (rfc 977) the server should use a sliding
|window to assume years to the closest century: 
|
|>3.7.1.  NEWGROUPS>   >NEWGROUPS date time [GMT] [<distributions>]>
|   >A list of newsgroups created since <date and time> will be listed in
|   >the same format as the LIST command.
|   >The date is sent as 6 digits in the format YYMMDD, where YY is the
|   >last two digits of the year, MM is the two digits of the month (with
|   >leading zero, if appropriate), and DD is the day of the month (with
|   >leading zero, if appropriate).  The closest century is assumed as
|   >part of the year (i.e., 86 specifies 1986, 30 specifies 2030, 99 is
|   >1999, 00 is 2000).
|but in my tests i have found nntp servers which did not seem to comply.
|Example: asking for newnews 00<today> gave me *all* articles
|rather than zero articles as it should.
|
|this is a classic example of a y2k bug that the pointy hair types will
|claim is "a non issue" but is actually a problem that needs to be tested
|for..

You didn't provide much info on this "test" that you ran.

Since it dosn't make much sense to ask for "any article posted more than 2 
years into the future" I would say that the program behaved properly in giving 
you "all articles posted since 1900".

To test this properly you would need to set the date *on the server* to after 
2000, then ask for newnews 00xxyy.

You may well have done this, but it wasn't clear from the post.


--  
Paul Colquhoun                              Ph:  +61 2 9850-0901
Systems Administrator                      fax:  +61 2 9850-0817
TPG Internet                             email:  pcolquh@tpgi.com.au
65 Waterloo Rd
North Ryde, NSW 2113                Unless otherwise stated, this message
Australia                           does NOT reflect official TPGi policy

There are year 2000 problems in INN 1.5.1
#17979
Author: Della Lu
Date: Sat, 24 May 1997 00:00
167 lines
4778 bytes
After looking at the Year 2000 problems of INN 1.4 unoff 4 I looked
at INN 1.5.1 and found the same problems. These problems mean that
NEWNEWS and NEWGROUPS will not get new news or new groups created after
23:59:59 12/31/1999. Articles with dates such as:

23 May 97 19:25:45 GMT

will also be rejected as too old. And anything that uses parsedate may
not work as expected (needs 4 digit years to work properly). The
parsedate documentation is incorrect in saying it is year 2000 safe.

This stuff needs to be fixed fairly soon.

You need to change NNTPtoGMT [nnrpd/misc.c Line 222] from:

for (seconds = 0, year += 1900, i = 1970; i < year; i++)
  seconds += DaysInYear(i);


To this if you want it to work for 98 years:

for (seconds = 0, year += year<96?2000:1900, i = 1970; i < year; i++)
  seconds += DaysInYear(i);


Or this is a permanent solution:

[Add at line 195]
time_t ltime;
struct tm *today;
int currentyear;

[Add and change at Line 222]
time(&ltime);
today = gmtime(&ltime);
currentyear=today->tm_year+1900;
year=((currentyear/100)*100)+year;
if(year-currentyear>50)
  year-=100;
else if(year-currentyear<-50)
  year+=100;
for (seconds = 0, i = 1970; i < year; i++)
  seconds += DaysInYear(i);


parsedate() will also fail due to a problem with Convert(), 
RelativeMonth() will fail very badly due to the interaction between
that Convert() problem interacting with DSTcorrect().
 
Convert() [lib/parsedate.y Line 513] should be changed from:

if (Year < 0)
  Year = -Year;
if (Year < 100)
  Year += 1900;
if (Year < EPOCH)
  Year += 100;
 
[Who knows what they were trying to do with that last line, it would
have bad side effects after 1999]

To this if you want it to work for 39 years:
 
if (Year < 0)
  Year = -Year;
if (Year < 100)
  Year += Year<96?2000:1900;
if (Year < EPOCH) /* struct tm years */
  Year += 1900;


Or this is a permanent solution:

Change line 500-534 of parsedate.y from:

static int  DaysLeap[13] = {
  0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
  };
static int  LeapYears[] = {
  1972, 1976, 1980, 1984, 1988, 1992, 1996,
  2000, 2004, 2008, 2012, 2016, 2020, 2024, 2028, 2032, 2036
  };
register int  *yp;
register int  *mp;
register time_t Julian;
register int  i;
time_t    tod;

if (Year < 0)
  Year = -Year;
if (Year < 100)
  Year += 1900;
if (Year < EPOCH)
  Year += 100;
for (mp = DaysNormal, yp = LeapYears; yp < ENDOF(LeapYears); yp++)
  if (Year == *yp) {
    mp = DaysLeap;
    break;
    }
if (Year < EPOCH || Year > END_OF_TIME
    || Month < 1 || Month > 12
    /* NOSTRICT *//* conversion from long may lose accuracy */
    || Day < 1 || Day > mp[(int)Month])
  return -1;

Julian = Day - 1 + (Year - EPOCH) * 365;
for (yp = LeapYears; yp < ENDOF(LeapYears); yp++, Julian++)
  if (Year <= *yp)
    break;
for (i = 1; i < Month; i++)
  Julian += *++mp;


[Just what was the person who wrote the leap-year handling stuff thinking?!]

Change to this:

static int  DaysLeap[13] = {
  0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
  };
register int  *mp;
register time_t Julian;
register int  i;
time_t    tod;

if (Year < 0)
  Year = -Year;
if (Year < 100)
  {
  time_t ltime;
  struct tm *today;
  int currentyear;
  time(&ltime);
  today = gmtime(&ltime);
  currentyear=today->tm_year+1900;
  Year=((currentyear/100)*100)+year;
  if(Year-currentyear>50)
    Year-=100;
  else if(Year-currentyear<-50)
    Year+=100;
  Year += Year<96?2000:1900;
  }
if (Year < EPOCH) /* struct tm years */
  Year += 1900;

mp=Year%4?DaysNormal:(Year%100?DaysLeap:(Year%400?DaysLeap:DaysNormal));

if (Year < EPOCH || Month < 1 || Month > 12
    /* NOSTRICT *//* conversion from long may lose accuracy */
    || Day < 1 || Day > mp[(int)Month])
  return -1;

Julian=Day-1;
for(i=EPOCH;i<=Year;i++)
  Julian+=i%4?365:(i%100?366:(i%400?366:365));
for (i = 1; i < Month; i++)
  Julian += *++mp;


The permanent solutions are a bit much for a once in 100 years event.

-- 
Della "will sort year 2000 problems for food" Lu


Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads