[Info-vax] test---ignore

Arne Vajhøj arne at vajhoej.dk
Mon Feb 20 13:31:04 EST 2023


On 2/20/2023 1:22 PM, Phillip Helbig (undress to reply) wrote:
> Please respond via email, removing the obvious spam-block!

This is posted and emailed.

> My news server aioe.org has died.  Many people have recommended
> eternal-september as a news server, so I signed up.  Works fine via
> telnet/port=119 (which is how I'm posting this).  I want to stick with
> NEWSRDR.  I discovered that it has had username/password authentication
> since 1993:
> 
> **      21-SEP-1993 V1.3    Madison     Add authentication support.

Those were the days.

:-)

 > There doesn't seem to be any way to authenticate interactively nor to
 > tell it (via a logical name or whatever) to always authenticate.  The
 > idea is that if the server requests it, then one will be prompted for
 > username and password.  However, the server does allow unauthenticated
 > access to a small number of newsgroups, so returns
 >
 >     200 reader01.eternal-september.org InterNetNews NNRP server INN 2.8.0
 >     (20220715 snapshot) ready (posting ok)
 >
 > which doesn't trigger the authentication.
 >
 > The sources are available.  For a C programmer it's probably a matter of
 > a few minutes to modify the code to always authenticate when connecting.
 > Probably enough to copy the code above (without the "if" stuff) to
 > somewhere else so that it is always executed immediately after
 > connecting.


>      if (reply_code == NNTP__AUTHREQD) {
> 
> ***************
>          put_output("Authentication required for posting.");
> 
> 
>          strcpy(tmp, "AUTHINFO USER ");
>          get_cmd(tmp+14, sizeof(tmp)-14, "Username: ");
>          server_send(tmp);
>          server_get_reply(SRV__NOECHO, &reply_code, 0, 0, 0);
> 
>          if (reply_code == NNTP__PASSWREQD) {
>              strcpy(tmp, "AUTHINFO PASS ");
>              get_cmd_noecho(tmp+14, sizeof(tmp)-14, "Password: ");
>              server_send(tmp);
>              server_get_reply(SRV__NOECHO, &reply_code, 0, 0, 0);
>          }
> 
>          if (reply_code != NNTP__AUTHACCEPTED) {
>              lib$signal(NEWS__NOPOSTING, 0);
>              return NEWS__NOPOSTING;
>          }
> 
>          server_send("POST");
>          server_get_reply(SRV__NOECHO, &reply_code, 0, 0, 0);
> 
>      }

My take:

         strcpy(tmp, "AUTHINFO USER ");
         strcpy(tmp+14, getenv("NNTP_USERNAME"));
         server_send(tmp);
         server_get_reply(SRV__NOECHO, &reply_code, 0, 0, 0);

         if (reply_code == NNTP__PASSWREQD) {
             strcpy(tmp, "AUTHINFO PASS ");
             strcpy(tmp+14, getenv("NNTP_USERNAME")):
             server_send(tmp);
             server_get_reply(SRV__NOECHO, &reply_code, 0, 0, 0);
         }

         if (reply_code != NNTP__AUTHACCEPTED) {
             lib$signal(NEWS__NOPOSTING, 0);
             return NEWS__NOPOSTING;
         }

         server_send("POST");
         server_get_reply(SRV__NOECHO, &reply_code, 0, 0, 0);

Very much untested.

:-)

Arne





More information about the Info-vax mailing list