🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #80995

Re: help debug this nntpcache section

#80995
From: D. Stussy
Date: Tue, 12 May 2009 22:41
38 lines
2339 bytes
"Etian" <54698212@sonic-news.com> wrote in message
news:ovmOl.56299$ew.39243@newsfe24.iad...
> I'm not a C programmer, but I got nntpcache (3.0.2) to work when I
> replaced this code segment with simple assignment to list->user and
> list->pass and skipped parsing it from the config file.  Otherwise, it
> crashes whenever you try to assign a username and password to the host
> from the config file.  It works if you are using a host that doesn't
> require login (e.g. host="news.xxxxx.com").  It crashes when you specify
> a username and password (e.g.
host="myusername:mypassword@news.xxxxx.com")
>
> Here is the code segment from nntpcache.c
>
> /* if there's a @ in host there's a user and password */
>         hostname = username = password = NULL;
> if (strchr(host, '@') != NULL)
> {
> if ((password = strrchr(host, ':')) != NULL)
> *(password++) = '\0';
> else
> {
> loge (("missing password in %s:%d: %s", file, n, buf));
> continue;
> }
> if ((hostname = strrchr(password-2, '@')) != NULL) {
> *(hostname++) = '\0';
> username = host;
> list->user = Sstrdup (username);
> list->pass = Sstrdup (password);
> }
> } else {
> hostname = host;
> }

Note:  If the host is specified as an IPv6 address literal, this code could
fail.

Technical Details
Message-ID: <guctvc$2nl$1@aux.snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!news.snarked.org!not-for-mail
References: <ovmOl.56299$ew.39243@newsfe24.iad>

Show Full Headers
Complete Article Headers
Message-ID: <guctvc$2nl$1@aux.snarked.org>
Subject: Re: help debug this nntpcache section
Date: Tue, 12 May 2009 15:41:39 -0700
From: "D. Stussy" <spam@bde-arc.ampr.org>
References: <ovmOl.56299$ew.39243@newsfe24.iad>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!weretis.net!feeder1.news.weretis.net!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 38
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-106-211-188.lsanca.dsl-w.verizon.net
X-Trace: aux.snarked.org 1242168108 2805 71.106.211.188 (12 May 2009 22:41:48
 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Tue, 12 May 2009 22:41:48 +0000 (UTC)
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478