🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Steve Thu, 21 Feb 2008 20:53
Cleanfeed binary logic
#78765
Author: Steve
Date: Thu, 21 Feb 2008 20:53
48 lines
2891 bytes
Hi all,

I'm looking at the binary filtering in Cleanfeed and am confused by
the logic employed within the EMP MD5 segment of the code.

If a binary posting is made to a bin_allowed group, it will pass the
early is_binary check.  So far so good.

When that posting hits the MD5 segment of code[1], the is_binary check
is only performed if fuzzy_md5 is true.  This means that binary posts to
legitimate binary groups are subjected to MD5 filtering if fuzzy_md5 is
false (or fuzzy_max_length is exceeded).

This behaviour seems odd to me.  I don't understand why the MD5 filter
should hash / reject binary articles.  Before hacking around with it, I
thought it best to check there isn't a good reason for it being the way
it is.

[1]     # create MD5 body checksum hash.
        if ($config{do_md5} and not $gr{md5skip}
                and not ($hdr{References} and $config{md5_skips_followups})
                and (($config{md5_max_length}
                        and $lines < $config{md5_max_length})
                    or not $config{md5_max_length})
                and $lines > 0 and ($lines > 2
                    or ($lines < 3 and $hdr{__BODY__} !~ /^\s{0,8}$/))) {
            my $mbody;
            if ($config{fuzzy_md5}
                    and (($config{fuzzy_max_length}
                            and $lines < $config{fuzzy_max_length})
                        or not $config{fuzzy_max_length})
                    and not is_binary()) {
                $mbody = lc $hdr{__BODY__};
                $mbody =~ s/^(?!http)\S{7,70}\r?$//mg;
                $mbody =~ s/\r{3}.*$//mg;
                $mbody =~ s/\s+$//;
                $mbody =~ s/^[^\n]*\Z//m if $lines > 5;
                $mbody =~ tr/a-z0-9//cd;
            }
            return reject('EMP (md5)', 'EMP')
                if $MD5history->add(md5_hex($mbody || $hdr{__BODY__}));
        }


-- 
pub   1024D/228761E7 2003-06-04 Steven Crook
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
uid                  Steven Crook <steve@mixmin.net>
Re: Cleanfeed binary logic
#78767
Author: Steve
Date: Fri, 22 Feb 2008 08:53
12 lines
1300 bytes
On Thu, 21 Feb 2008 20:53:06 +0000 (UTC), Steve wrote in
Message-Id: <fpkobi$f95$1@news.mixmin.net>:

> I'm looking at the binary filtering in Cleanfeed and am confused by
> the logic employed within the EMP MD5 segment of the code.

Sorry, ignore that one, just being dopey.

-- 
pub   1024D/228761E7 2003-06-04 Steven Crook
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
uid                  Steven Crook <steve@mixmin.net>
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