Article View: news.software.readers
Article #19566Re: using authentication with tin - patch to tin included
From: Gordon Moffett
Date: Mon, 26 Feb 1996 00:00
Date: Mon, 26 Feb 1996 00:00
86 lines
3340 bytes
3340 bytes
In article <4gngca$sti@rodelo.cyberverse.com>,
Boris Vallejo <boris@hondo.cyberverse.com> wrote:
> I'm interested in a news server called 'alt.net', and am having trouble
> even testing the test account they provide. I'm using tin with the env
> var set NNTPSERVER=news.alt.net and a .newsauth entry of 'news.alt.net
> altnet' (according to the man page, .newsauth is 'nntpserver password'
> pairs, though I have no clue where the account name (testnntp for the
> test login) fits in.
>
> Using this, I just get nearly immediate server timeouts and associated
> y/n requestor.
>
> If anyone out there has successfully used tin on this service, I'd
> especially appreciate your insights.
>
> Thx, =boris=
I wasn't able to use alt.net until 1): he created a id for me, or 2) I
patched tin to allow for 'nntpserver userid password' format (as well
as the current default).
In any case, I found that alt.net didn't have a full feed of articles,
and have found a better service in net-link.com, which lets me use trn.
the patch to tin-122 to allow for the 'nntpserver userid password'
in .newsauth is included below.
It also fixes a bug in tin that uses "sizeof(server)" where 'server'
is declared as 'char *' -- the server name is matched only on the first
four characters ....
*** /tmp/da004Hz Wed Dec 31 16:00:00 1969
--- open.c Fri Feb 9 17:33:39 1996
***************
*** 957,966 ****
--- 957,970 ----
{
char authfile[PATH_LEN];
char authpass[PATH_LEN];
+ char authhost[PATH_LEN]; /* 1st string in .newsauth line */
+ char arg2[PATH_LEN]; /* 2nd string in .newsauth line */
+ char arg3[PATH_LEN]; /* 3rd string in .newsauth line (optional) */
char line[NNTP_STRLEN];
char buf[PATH_LEN], *ptr;
int found = FALSE;
FILE *fp;
+ int w; /* # of fields found in .newsauth line */
/*
* Check if running via NNTP
***************
*** 986,991 ****
--- 990,998 ----
* File has format: 'nntp-server' 'password'
*/
while (fgets (buf, sizeof (buf), fp) != (char *) 0) {
+ w = sscanf(buf, "%s %s %s", authhost, arg2, arg3);
+ if (strncmp(authhost, server, strlen(server)) == 0) {
+ #ifdef undef
/*
* Get server from 1st part of the line
*/
***************
*** 1006,1011 ****
--- 1013,1027 ----
if (ptr != (char *) 0) {
*ptr = '\0';
}
+ found = TRUE;
+ }
+ #endif
+ if (w == 2) { /* 2nd arg is passwd */
+ strcpy(authpass, arg2);
+ found = TRUE;
+ } else if (w == 3) {
+ authuser = arg2;
+ strcpy(authpass, arg3);
found = TRUE;
}
break;
--
Gordon Moffett
Portland, Oregon
Technical Details
Message-ID:
<gamDnDBL5.5vE@netcom.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-mailReferences:
<4gngca$sti@rodelo.cyberverse.com>Show Full Headers
Complete Article Headers
Message-ID: <gamDnDBL5.5vE@netcom.com> Subject: Re: using authentication with tin - patch to tin included Date: Mon, 26 Feb 1996 00:00:00 +0000 From: gam@netcom.com (Gordon Moffett) References: <4gngca$sti@rodelo.cyberverse.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 X-Deja-AN: 141155832 Sender: gam@netcom10.netcom.com Organization: Netcom Public Unix/Internet, Beaverton, OR Newsgroups: news.software.readers