🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Sven Gottwald Sat, 25 Dec 1999 00:00
possible bug in INN 2.2.1 perl filtering (filter_nnrpd.pl)
#42512
Author: Sven Gottwald
Date: Sat, 25 Dec 1999 00:00
49 lines
1916 bytes
Hohoho!

I'm using INN 2.2.1 on my Linux-box as local newsserver and tried to use

---SNIP---
sub filter_post {
	$modify_headers = 1;
	$hdr{"X-Trace"} = "";
}
---SNAP---  

in filter_nnrpd.pl to remove the X-Trace header (I didn't want to
modify the source). But with that modification the header of a test
posting to a local group looks like that:

| Path: sauron.ddns.org!svengo
| From: Sven Gottwald <svengo@gmx.net>
| Newsgroups: local.test
| Subject: Test (hopefully) without X-Trace
| Date: 25 Dec 1999 19:46:55 GMT
| Organization: United Federation of Planets
| Lines: 5
| Message-ID: <slrn86a7pf.19p.svengo@sauron.ddns.org>
| NNTP-Posting-Host: localhost
| X-Complaints-To: usenet@sauron.ddns.org
| NNTP-Posting-Date: 25 Dec 1999 19:46:55 GMT
| X-No-Archive:  yes
               ^^
| Mail-Copies-To:  never
                 ^^
| User-Agent:  slrn/0.9.6.1 (Linux)
             ^^
| Xref: sauron.ddns.org local.test:60

The same (of course /with/ a X-Trace Header ;-) happens if I only use 

---SNIP---
sub filter_post {
	$modify_headers = 1;
 	"";
}
---SNAP---

Does anyone have the same problem? (btw I'm using perl 5.005_03.)

TIA
   Sv'Sorry for my not so good English'en

Re: possible bug in INN 2.2.1 perl filtering (filter_nnrpd.pl)
#47002
Author: Russ Allbery
Date: Tue, 20 Jun 2000 00:00
65 lines
2603 bytes
[ Posted and mailed. ]

Sorry for how long it took me to look at this, and thanks for the report!

Sven Gottwald <svengo@gmx.net> writes:

> I'm using INN 2.2.1 on my Linux-box as local newsserver and tried to use

> ---SNIP---
> sub filter_post {
> 	$modify_headers = 1;
> 	$hdr{"X-Trace"} = "";
> }
> ---SNAP---  

> in filter_nnrpd.pl to remove the X-Trace header (I didn't want to modify
> the source). But with that modification the header of a test posting to
> a local group looks like that:

[...]

> | X-No-Archive:  yes
>                ^^
> | Mail-Copies-To:  never
>                  ^^
> | User-Agent:  slrn/0.9.6.1 (Linux)
>              ^^
> | Xref: sauron.ddns.org local.test:60

> The same (of course /with/ a X-Trace Header ;-) happens if I only use 

> ---SNIP---
> sub filter_post {
> 	$modify_headers = 1;
>  	"";
> }
> ---SNAP---

> Does anyone have the same problem? (btw I'm using perl 5.005_03.)

The header code was including the space after the colon as part of the
contents of the header, but the code for glueing the headers back together
when $modify_headers was set was adding a space.  After thinking about it
for a moment, I think it's correct to consider the space not part of the
header value but part of the format of the article headers and omit it.

Here's a patch.  I'll commit this to STABLE, BETA, and CURRENT.

--- nnrpd/perl.c	2000/06/05 00:14:20	1.14
+++ nnrpd/perl.c	2000/06/21 02:39:31
@@ -95,7 +95,8 @@
           continue;
         }
         s++;
-        hv_store(hdr, p, (s - p) - 1, newSVpv(s, 0), 0);
+        t = (*s == ' ' ? s + 1 : s);
+        hv_store(hdr, p, (s - p) - 1, newSVpv(t, 0), 0);
    }
    /* Store user */
    sv_setpv(perl_get_sv("user",TRUE), PERMuser);

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads