Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Jan 2000 09:42:52 +1100 (EST)
From:      Gregory Bond <gnb@itga.com.au>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/15926: [patch] y2k bug in leafnode+ causes lost news
Message-ID:  <200001052242.JAA31087@hellcat.itga.com.au>

next in thread | raw e-mail | index | archive | help

>Number:         15926
>Category:       ports
>Synopsis:       y2k bug in leafnode+ causes lost news
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan  5 14:50:02 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Gregory Bond
>Release:        FreeBSD 3.4-STABLE i386
>Organization:
ITG Australia Limited
>Environment:

FreeBSD 3.4-STABLE (or any FreeBSD version), leafnode+ 2.8 from the 
ports collection (also present in the latest 2.9 version)

>Description:

A y2k bug in leafnode+ 2.9 considers incoming news articles with the 
(arguably bogus) Date: header like
	Wed, 05 Jan 00 15:01:40 GMT
to be too old, so these incoming articles are dropped.

[They seem to account for about 5% of the articles received at this site.]

>How-To-Repeat:

Run fetchnews with -vv and note the lines on stderr like
	102715 is posted more than 1003 days ago: Wed, 05 Jan 00 15:01:40 GMT


>Fix:

[This has been reported to the current maintainer of leafnode+ (jam@pobox.com)
 and appears here as a PR for the record...]
[As an aside, the port is still on leafnode+ 2.8.]
[As a further aside, this code is never going to work right for leapyears,
 being off by 1 day after Feb29, but that probably doesn't matter in 
 this context ]

--- artutil.c.orig	Sat Oct  9 13:19:25 1999
+++ artutil.c	Thu Jan  6 09:18:32 2000
@@ -287,7 +287,10 @@
 
     if (sscanf(d, "%d %10s %d", &day, monthname, &year) < 3) {
 	return 1003;
-    } else if (!((year > 95 && year < 100) || (year > 1995))) {
+    } 
+    /* Accept broken posters who have "Wed, 05 Jan 00 10:08:53 GMT" */
+    if (year >= 0 && year < 50) year += 2000;
+    if (!((year > 95 && year < 100) || (year > 1995))) {
 	return 1004;
 #if DATESTRICT
     } else if (strlen(monthname) != 3) {

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200001052242.JAA31087>