🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #83909

Re: Maybe a bug in X-Trace nnrpd generation (INN 2.5.2)

#83909
From: Julien ÉLIE
Date: Tue, 01 Mar 2011 11:03
65 lines
4220 bytes
Hi Russ,

> I think the stdin comes from nnrpd's StartConnection() here:
>
>      /* Get the peer's name. */
>      length = sizeof(ssc);
>      if (getpeername(STDIN_FILENO, sac,&length)<  0) {
>          if (!isatty(STDIN_FILENO)) {
>              sysnotice("? can't getpeername");
>              Reply("%d Can't get your name.  Goodbye!\r\n", NNTP_ERR_ACCESS);
>              ExitWithStats(1, true);
>          }
>          strlcpy(Client.host, "stdin", sizeof(Client.host));

Oh, yes, you're totally right.
I had not had a look at the source code when answering Paolo.  So it now 
explains a few things and gives answers to the questions raised in this 
thread.

1/ nnrpd cannot use "stdin" when a message is sent by a remote host 
because the connection is dropped (502 Can't get your name.  Goodbye!) 
unless it comes from stdin (0).

2/ to solve issues with the X-Trace: header field, we need to set an IP 
so I believe adding
     strlcpy(Client.ip, "127.0.0.1", sizeof(Client.ip));
after setting Client.host in this special case (to "localhost" now) is 
what we should do *for INN 2.5*.
No change for INN 2.6 which does not generate X-Trace information.  We 
will end up with "localhost" in the Injection-Info: header body, which 
is fine.  No further IP.

It is amusing to see that we are fixing an historic bug in X-Trace 
information now it has been deprecated and no longer used in CURRENT 
versions of INN.



> so we're the ones who are introducing the word.  I'm not sure what to do
> instead, although 127.0.0.1 or ::1 both seem reasonable to me.

Maybe, as Dieter suggests, "localhost" is better for Client.host (a 
numerical address would be for Client.ip).


A remaining issue is when "nnrpd -n" is used, with no DNS resolution. 
The host is "?" and will be used as-is in headers.  It is not good, 
especially in a Path: header field like "me!.POSTED.?!not-for-mail" or 
in "?:1.2.3.4" in the Injection-Info: header field.

A straightforward fix would be to make "?" a variable, named 
UNRESOLVED_HOST, and set/check the value of Client.host with this 
variable.  We would then put the IP in the Path: header field, and only 
the IP (with no host) in the Injection-Info: header field.

This is a genuine bug in both NNTP-Posting-Host: and Injection-Info: 
header fields when DNS resolution is off.  I suggest the same fix for 
them (INN 2.5 and INN 2.6 respectively).
When the Sender: header field is automatically added, we also have to 
check that we do not add "user@?" but only "user".

-- 
Julien ÉLIE

« J'aime le travail, je passerais des heures à le regarder. »
Technical Details
Message-ID: <ikijqs$1l6$1@news.trigofacile.com>
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.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!gegeweb.org!news.trigofacile.com!.POSTED.amontpellier-159-1-118-169.w86-211.abo.wanadoo.fr!not-for-mail
References: <ikfnh8$g2c$1@speranza.aioe.org> <ikfpan$s8e$1@news.trigofacile.com> <ikfs40$svf$1@speranza.aioe.org> <8t1cj4FifjU1@mid.individual.net> <874o7onhsm.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <ikijqs$1l6$1@news.trigofacile.com>
Subject: Re: Maybe a bug in X-Trace nnrpd generation (INN 2.5.2)
Date: Tue, 01 Mar 2011 12:03:56 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <ikfnh8$g2c$1@speranza.aioe.org> <ikfpan$s8e$1@news.trigofacile.com> <ikfs40$svf$1@speranza.aioe.org> <8t1cj4FifjU1@mid.individual.net> <874o7onhsm.fsf@windlord.stanford.edu>
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.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!gegeweb.org!news.trigofacile.com!.POSTED.amontpellier-159-1-118-169.w86-211.abo.wanadoo.fr!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 1 Mar 2011 11:03:56 +0000 (UTC)
Injection-Info: news.trigofacile.com;
 posting-host="amontpellier-159-1-118-169.w86-211.abo.wanadoo.fr:86.211.21.169";
 logging-data="1702"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fr;
In-Reply-To: <874o7onhsm.fsf@windlord.stanford.edu>
Lines: 64
X-Original-Bytes: 3947