🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #82589

Re: Injection-Info questions

#82589
From: Steve Crook
Date: Thu, 14 Jan 2010 20:37
18 lines
1842 bytes
On Tue, 12 Jan 2010 10:47:54 +0000 (UTC), Steve Crook wrote in
Message-Id: <slrnhkokqq.mgt.steve@news.mixmin.net>:

> Yes, I hadn't considered the presence of a semi-colon in a
> quoted-string.  It's an invalid atom character but for quoted-strings,
> any printable ASCII is valid, excluding \ and ".  I'll need to think
> about how to handle that one.

After much cogitating, I've decided this is a nightmare to handle with a
regex.  Quote chars can be in Comments, Comment chars in Quotes and '='
and semi-colons in both of them.  It's easier to parse it on a
char-by-char basis and then validate the resulting strings against atom,
dot-atom and quoted-text regexs.

Here's a first stab at it:
http://www.mixmin.net/cleanfeed/injectinfo
I can still find ways to break this with malformed data but it's much
easier to fix than the equivalent monster regexs I've tried.
Technical Details
Message-ID: <slrnhkv04b.mgt.steve@news.mixmin.net>
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!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!not-for-mail
References: <slrnhjcc9b.u40.steve@news.mixmin.net> <hicoat$fun$1@news.trigofacile.com> <slrnhkm0mt.lhj.steve@news.mixmin.net> <hig5ra$9lr$1@snarked.org> <slrnhkokqq.mgt.steve@news.mixmin.net>

Show Full Headers
Complete Article Headers
Message-ID: <slrnhkv04b.mgt.steve@news.mixmin.net>
Subject: Re: Injection-Info questions
Date: Thu, 14 Jan 2010 20:37:31 +0000
From: Steve Crook <steve@mixmin.net>
References: <slrnhjcc9b.u40.steve@news.mixmin.net> <hicoat$fun$1@news.trigofacile.com> <slrnhkm0mt.lhj.steve@news.mixmin.net> <hig5ra$9lr$1@snarked.org> <slrnhkokqq.mgt.steve@news.mixmin.net>
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!border2.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Mixmin
Injection-Date: Thu, 14 Jan 2010 20:37:31 +0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="ip6-localhost:::1";
 logging-data="17183"; mail-complaints-to="abuse@mixmin.net"
User-Agent: slrn/pre1.0.0-18 (Linux)
Lines: 17