🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
2 messages
2 total messages Started by Todd D. Taft Wed, 07 Feb 1996 00:00
TRN/INN Repeatedly asking about same "new" newsgroups
#18635
Author: Todd D. Taft
Date: Wed, 07 Feb 1996 00:00
32 lines
2592 bytes
Recently our news reader programs (primarily trn) have started telling
our users that new newsgroups have been created, and asking users if
they would like to subscribe to these certain newsgroups every time
that they start up the program.  It will only ask about newsgroups
that are not listed in the user's .newsrc file, but it won't ask about
every newsgroup not listed in the .newsrc file.  The only pattern that
I can detect is that the ones that users keep getting prompted about
have been newgrouped on our server relatively recently.  Our server
used to allow users to list only the newsgroups they cared about in
their .newsrc; when a new group was created, their reader would ask
them (once!) if they wanted to subscribe, and if they didn't, no
addition would be made to their .newsrc file.  I am not aware of any
changes in our news server (INN 1.4) or our newsreaders (trn 3.4.1,
trn 3.6, etc.) that would suddenly cause this to break.  The only
problem I'm aware of that might affect this is the fact that, for a
while, our INN was running as root, because one of the admins didn't
know to run inn as news.  I'm guessing that one of the INN database
files got corrupted when this happened, but I have no idea which one;
at a glance, they all look ok to me, though I'm relatively new to the
news admin buisiness, and certainly no news.god... Our news server is
running INN1.4 on a Solaris 2.3 machine.  Our news resides on 3 disks:
1 for inn software and its config files; 1 for "important" hierachies
like "comp.*", and another for "unimportant" hierarchies like
"alt.*". This problem seems to occur for newsgroups located on both of
our news disks.  Any suggestions as to how to fix this problem?

-- 
Todd D. Taft                              taft@cs.unc.edu
WWW: http://www.cs.unc.edu/~taft/         todd_taft@unc.edu
U.N.C. Department of Computer Science Facilities Staff

Re: TRN/INN Repeatedly asking about same "new" newsgroups
#18674
Author: Michael Hucka
Date: Wed, 07 Feb 1996 00:00
154 lines
5993 bytes
>>>>> On 7 Feb 1996, taft@cs.unc.edu (Todd D. Taft) wrote:

  taft> Recently our news reader programs (primarily trn) have started
  taft> telling our users that new newsgroups have been created, and asking
  taft> users if they would like to subscribe to these certain newsgroups
  taft> every time that they start up the program.  It will only ask about
  taft> newsgroups that are not listed in the user's .newsrc file, but it
  taft> won't ask about every newsgroup not listed in the .newsrc file.  The
  taft> only pattern that I can detect is that the ones that users keep
  taft> getting prompted about have been newgrouped on our server relatively
  taft> recently.  Our server used to allow users to list only the newsgroups

  taft> .... [rest deleted] ....

This kind of sounds like the trn leap year bug.  Attached is the patch 
posted last month:

 From: anne@alcor.concordia.ca ( Anne Bennett )
 Subject: Re: trn-3.4.1 keeps asking about new groups!
 Date: 11 Jan 1996 20:44:37 GMT
 Newsgroups: news.software.readers,news.admin.misc,news.software.nntp
 Organization: Concordia University, Montreal, Canada
 Lines: 124
 Message-ID: <4d3srl$qb1@newsflash.concordia.ca>
 References: <DKnuzI.FsG@yc.estec.esa.nl> <4cgtn4$npm@sidhe.hsc-sec.fr> <4clqq6$j5c@newsflash.concordia.ca>
 

I wrote:

> That patch is not correct [...]
> A better patch is being
> elaborated on the trn testers' mailing list.  I can post it here when
> it's done.

1)  I was wrong; the patch was OK, at least until 2100.  I re-append it here
    as the "simple patch".
2)  A more correct but more complicated patch, appended here as "fancy
    patch", was submitted, which will work until 2400.

Wayne Davison, author of trn, writes that he will go with the simple patch
because the resulting calculation is faster, and he hopes no-one will still
be using trn in the year 2100.  :-)   I am using the fancy patch at my site.

Pick your own favourite; either will work.  BTW, you should have no trouble
applying these patches to strn-0.9.2, if that's what you're using, though
the line numbers are for trn-3.6.



Anne.
--
Ms. Anne Bennett          anne@alcor.concordia.ca            (514) 848-7606
Computing Services,   Concordia University,   Montreal QC,   Canada H3G 1M8
(Administrator for Concordia University mail relay and news transfer) 
----------------------------------------------------------------------------
SIMPLE PATCH THAT WORKS UNTIL 2100

Submitted by Miquel van Smoorenburg <miquels@debian.het.net>, reposted
to trn-test list by jml4@cus.cam.ac.uk (John Line)>

===== the patch (to nntp.c, line numbers are for trn 3.6)

------- nntp.c -------
*** /tmp/da005NK	Thu Jan  1 00:00:00 1970
--- nntp.c	Wed Jan  3 20:43:11 1996
***************
*** 319,326 ****
      for (month--; month; month--)
  	day += maxdays[month];

!     ss = ((((year-1970) * 365 + (year-1968)/4 + day - 1) * 24L + hh) * 60
! 	  + mm) * 60 + ss;

      return ss;
  }
--- 319,326 ----
      for (month--; month; month--)
  	day += maxdays[month];

!     ss = ((((year-1970) * 365 + (year-1969)/4 + day - 1) * 24L + hh) * 60
!         + mm) * 60 + ss;

      return ss;
  }

----------------------------------------------------------------------------
FANCY PATCH THAT WORKS UNTIL 2400


From: pdc@lunch.engr.sgi.com (Paul Close)
Subject: Re: trn (3.6 & 4.0-test38) listing "new groups" that aren't new
To: trn-test@trn.com (TRN mailing list)
Date: Fri, 5 Jan 1996 16:43:27 -0800 (PST)

Okay, here's my fix.  This uses a proper leap year calculation, and should
work for a very long time :-)

--- trn-3.6/nntp.c	Fri Nov 18 22:01:23 1994
+++ nntp.c.leap	Fri Jan  5 16:38:33 1996
@@ -285,12 +285,13 @@
 
 /* This is a 1-relative list */
 static int maxdays[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
 
 time_t
 nntp_time()
 {
     char *s;
-    int year, month, day, hh, mm;
+    int year, month, day, hh, mm, y;
     time_t ss;
 
     nntp_command("XDATE" + (CompliantServer? 0 : 1));
@@ -306,11 +307,11 @@
     s[4] = '\0';
     year = atoi(s);
 
-    /* This simple algorithm will be valid until the year 2400 */
-    if (year % 4)
-	maxdays[2] = 28;
-    else
+    if (isleap(year))
 	maxdays[2] = 29;
+    else
+	maxdays[2] = 28;
+
     if (month < 1 || month > 12 || day < 1 || day > maxdays[month]
      || hh < 0 || hh > 23 || mm < 0 || mm > 59
      || ss < 0 || ss > 59)
@@ -319,8 +320,12 @@
     for (month--; month; month--)
 	day += maxdays[month];
 
-    ss = ((((year-1970) * 365 + (year-1968)/4 + day - 1) * 24L + hh) * 60
-	  + mm) * 60 + ss;
+    for (y = 1970; y < year; y++)
+	if (isleap(y))
+	    day += 366;
+	else
+	    day += 365;
+    ss += (((day - 1) * 24L + hh) * 60 + mm) * 60;
 
     return ss;
 }


----------------------------------------------------------------------------
-- 
Mike Hucka                   University of Michigan Artificial Intelligence Lab
hucka@umich.edu (X.500)            and EECS Departmental Computing Organization
http://ai.eecs.umich.edu/people/hucka/        Ann Arbor, Michigan 48109, U.S.A.

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