🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90172

Re: Seeking help modifying Diablo source to prevent miscategorization of articles containing PGP

#90172
From: Jesse Rehmer
Date: Mon, 20 Mar 2023 14:25
84 lines
4602 bytes
On Mar 20, 2023 at 5:36:15 AM CDT, "Tom Furie" <tom@furie.org.uk> wrote:

> On 2023-03-20, Jesse Rehmer <jesse.rehmer@blueworldhosting.com> wrote:
>> On Mar 19, 2023 at 10:25:12 PM CDT, "Jesse Rehmer"
>>> 
>>> Hrm, I guess another portion of the code higher up is taking precedence as
>>> this didn't change the behavior with messages like:
>>> <tv8i7j$q8m$1@rasp.pasdenom.info>
>> 
>> I'm thinking it is the portion of code right above the PGP stuff:
>> 
>>         } else if (linetype & B64) {
>>             UUencode = 0;
>>             BinHex = 0;
>>             Base64++;
>>             if (Base64 > 8) {
>>                 Type |= ARTTYPE_BASE64 | ARTTYPE_BINARY;
>>                 return(Type);
>>             }
>> 
>> I'm assuming this is counting any article with more than 8 lines of Base64
>> encoded text as binary?
> 
> That certainly seems to be the case. I'd be tempted to switch the order
> of this whole 'if-else' sequence so the check for "-----BEGIN PGP ..."
> comes before the binary tests.
> 
> Cheers,
> Tom

I may give this a try. I ended up disabling the IFILTER feed/label and it
stopped the behavior.

I'm a bit confused by it's intended behavior, as I thought it was only for
rejecting misplaced binaries, but looking at the logs I see it is identifying
these particular messages as some other type, but according to what is in
lib/defs.h, I can't quite make heads or tails of how these translate.

Take these two entries for example:

2023-03-20 01:00:03.737 somehost - <tv8sp3$fql$1@rasp.pasdenom.info> 2642
020b00 IncomingFilter
2023-03-20 01:00:03.738 somehost - <tv8sp3$fql$1@rasp.pasdenom.info> 2656
020b00 IncomingFilter

The article type logged is "020b00", which that string does not appear
anywhere in the source code. In lib/defs.h there is the following block:

/*
 * Article types that diablo can determine when receiving an article
 */

#define         ARTTYPE_NONE            0x000000

#define         ARTTYPE_DEFAULT         0x000001
#define         ARTTYPE_CONTROL         0x000002
#define         ARTTYPE_CANCEL          0x000004

#define         ARTTYPE_MIME            0x000100
#define         ARTTYPE_BINARY          0x000200
#define         ARTTYPE_UUENCODE        0x000400
#define         ARTTYPE_BASE64          0x000800
#define         ARTTYPE_MULTIPART       0x001000
#define         ARTTYPE_HTML            0x002000
#define         ARTTYPE_PS              0x004000
#define         ARTTYPE_BINHEX          0x008000
#define         ARTTYPE_PARTIAL         0x010000
#define         ARTTYPE_PGPMESSAGE      0x020000
#define         ARTTYPE_YENC            0x040000
#define         ARTTYPE_BOMMANEWS       0x080000
#define         ARTTYPE_UNIDATA         0x100000

#define         ARTTYPE_ALL             0xFFFFFF

Other articles that are misplaced binaries show up in the logs like this:

2023-03-20 02:50:35.991 somehost -
<001d0260a48f41ff95a5dd1ff1830a4d@lfxlxgf.ytv> 1737 050200 IncomingFilter

Where the article type is logged as "050200" but again, I'm having a hard time
understanding what this is truly supposed to indicated as its detected type.

I may be completely misunderstanding how the article type detection works and
how it is used.
Technical Details
Message-ID: <tv9qce$dtq$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <tv8ale$2t9m$1@nnrp.usenet.blueworldhosting.com> <tv8jmo$1kmu$1@nnrp.usenet.blueworldhosting.com> <tv8k5h$2i1s$1@nnrp.usenet.blueworldhosting.com> <tv9cuv$3ti$1@freeq.furie.org.uk>

Show Full Headers
Complete Article Headers
Message-ID: <tv9qce$dtq$1@nnrp.usenet.blueworldhosting.com>
Subject: Re: Seeking help modifying Diablo source to prevent miscategorization of articles containing PGP
Date: Mon, 20 Mar 2023 14:25:18 +0000
From: Jesse Rehmer <jesse.rehmer@blueworldhosting.com>
References: <tv8ale$2t9m$1@nnrp.usenet.blueworldhosting.com> <tv8jmo$1kmu$1@nnrp.usenet.blueworldhosting.com> <tv8k5h$2i1s$1@nnrp.usenet.blueworldhosting.com> <tv9cuv$3ti$1@freeq.furie.org.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: BlueWorld Hosting Usenet (https://usenet.blueworldhosting.com)
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 20 Mar 2023 14:25:18 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com; logging-data="14266"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:7V1PyYYEST2Iw0risMO8NipgW8g= sha256:pBt6XZYuCEEB72DzlAmUyCoE9Myvz0+9IogFx4AMCy0= sha1:6zof4xEcqsTUEcLv1b3sSqmJ6Iw= sha256:Jt5m5/5LafD1qiIY/70g7zSSyXAbqH4nxpwmXA6UN00=
X-Usenapp: v1.26.3/d - Full License