🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #28452

Re: Help - trn and zippo (or other authenticating NNTP servers)

#28452
From: Ron Newman
Date: Tue, 17 Dec 1996 00:00
126 lines
4850 bytes
Hello again everyone.

In our last episode, I asked how to make trn 3.6 work with an
authenticating NNTP server such as Zippo.  One helpful reader
suggested that I switch to a beta version of trn 4.0, which I
may eventually do.  In the meantime, however, the Zippo folks
helpfully provided a source patch which they claimed *should*
make trn 3.6 work with Zippo.  (I've appended it to the end
of this message.)

Well, the good news is that the patch does indeed supply
the correct authentication strings to the Zippo NNTp server
(snews.zippo.com).  The bad news is that trn 3.6 seems to
hang forever upon startup.

Upon closer examination (with the Gnu Debugger) I find that trn
is not in fact hanging, but is instead reading the server's entire "active"
file and building a huge hash table -- something that takes
quite a while when the server has as many newsgroups as Zippo.
trn is doing this because, when it starts up, one of the
first things it does is issue the following command to the
NNTP server:

   list active control

(see the function "ngdata_init" in ngdata.c, 
 and the function "nntp_list", in nntp.c).

The Super Zippo server snews.zippo.com, unfortunately, does not
respond properly to this command.  Instead of responding with the
expected 215, it sends back a fatal error:

   501 [active|newsgroups|distributions|schema]

As you'll see when looking at the code, this causes
nntp_list() to return -1, and ngdata_init() to fall
into a case which causes it to call ngdatahash_init(),
which builds the aforementioned hash table.

I assume that the Zippo NNTP server is buggy, rather than
the trn code, but that still leaves me without a useful
trn for this purpose.  Can someone recommend an additional
patch to trn 3.6 for this purpose?   

Two other questions:

Does trn 4.0 somehow avoid this problem?  

Why don't other NNTP clients besides trn run into this?

(Zippo's authentication patch to trn 3.6 follows.)

------------------------------------
----------------------------------------------------------------------------
*** nntpauth.c  Sat Dec 14 19:27:37 1996
--- nntpauth.c.orig     Sat Dec 14 18:57:29 1996
***************
*** 29,57 ****
   
      if (s = getenv("NNTPAUTH"))
        sprintf(ser_line, "%s %s", cmd, s);
-     else if(s = getenv("NNTPUSER"))
-       sprintf(ser_line, "AUTHINFO USER %s", s);
      else
        sprintf(ser_line, "%s any %s", cmd, loginName);
   
      /* issue authentication request */  
      nntp_command(ser_line);

!     if(s = getenv("NNTPPASS")) {
!         char line2[NNTP_STRLEN];
!
!       nntp_gets(line2, sizeof line2);
!       if (atoi(line2) != 381) {
!           ch = NNTP_CLASS_FATAL;
!       } else {
!           sprintf(ser_line, "AUTHINFO PASS %s", s); 
!           nntp_command(ser_line);
!           nntp_gets(line2, sizeof line2);
!           ch = atoi(line2);
!       }
!     }
!     else 
!       ch = (s? nntp_auth(s) : nntp_check(strict)); 
  
      if (ch == NNTP_CLASS_FATAL) {
        char tmpbuf[LBUFLEN];
--- 29,41 ----

      if (s = getenv("NNTPAUTH"))
        sprintf(ser_line, "%s %s", cmd, s);
      else
        sprintf(ser_line, "%s any %s", cmd, loginName);

      /* issue authentication request */
      nntp_command(ser_line);

!     ch = (s? nntp_auth(s) : nntp_check(strict));

      if (ch == NNTP_CLASS_FATAL) {
        char tmpbuf[LBUFLEN];
***************
*** nntpinit.c  Sat Dec 14 20:17:44 1996
--- nntpinit.c.orig     Sat Dec 14 18:57:29 1996
*************** 
*** 87,93 ****
      /* Now get the server's signon message */
      nntp_check(FALSE);
   
!     if (*ser_line == NNTP_CLASS_OK && getenv("NNTPUSER") == NULL) {
        char line2[NNTP_STRLEN];
        /* Send an XMODE READER command to see if this is a compliant
        ** nntpd we're talking to.  If not, try MODE READER just in
--- 87,93 ---- 
      /* Now get the server's signon message */
      nntp_check(FALSE); 

!     if (*ser_line == NNTP_CLASS_OK) {
        char line2[NNTP_STRLEN];
        /* Send an XMODE READER command to see if this is a compliant
        ** nntpd we're talking to.  If not, try MODE READER just in
***************


Technical Details
Message-ID: <597oap$mho@lois.zippo.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
References: <58v6q1$pr9@shell1.cybercom.net>

Show Full Headers
Complete Article Headers
Message-ID: <597oap$mho@lois.zippo.com>
Subject: Re: Help - trn and zippo (or other authenticating NNTP servers)
Date: Tue, 17 Dec 1996 00:00:00 +0000
From: Ron Newman <rnewman@cybercom.net>
References: <58v6q1$pr9@shell1.cybercom.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 204670964
Sender: usenet@sdrn.zippo.com
Organization: Zip News
Newsgroups: news.software.readers