πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81189

Re: Another INN 2.5.0 rc2 bug - control.ctl processing

#81189
From: D. Stussy
Date: Tue, 02 Jun 2009 03:15
220 lines
10963 bytes
"Julien Γ‰LIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:h004v2$4d1$1@news.trigofacile.com...
> > I thnk you missed part of the issue.  If the line is (and there are no
> > other matching lines):
> >
> > all:*:hierarchy1.*|hierarchy2.*|hierarchy3.*|hierarchy4.*:log=somewhere
> >
> > and the checkgroups message is only for "hierarchy5.*", NONE of the
> > specified groups are present in the file, and therefore, NOTHING should
be
> > done.
>
> I understand that this pattern will not match newsgroups in the
checkgroups
> you speak about but I would like something more robust than applying
> a pattern against a pattern to see that you want "hierarchy1.*" and
> that there is not "*a*" somewhere in the line.

Well , if the pattern were "all:*:hierarchy1.*|*a*:log=...", then
"hierarchy5.*" would match, so I don't see a problem.

> > If the control line was:
> >
> >  Control:  checkgroups hierarchy5.*
> >
> > then see my comments in the last paragraph and the PATCH that follows.
> >
> >                 if ($type eq 'checkgroups') {
> > -                    push (@$matches, [ $action, $logname,
$ctlline[2] ]);
> > +                    push (@$matches, [ $action, $logname,
$ctlline[2] ])
> > +                        if (!$newsgroup || $newsgroup =~
/$ctlline[2]/);
> >                 }
>
> Hey, but it is what I keep telling you and you provide a patch which
breaks
> a lot of things!
>
> checkgroups:*:*binaries*:drop
>
> "hierarchy5" is not matched by "/.*binaries.*/" at all and therefore not
> taken into account.

Exactly the result I would expect.  Remember that the checkgroups parameter
is the hierarchy name (or pattern), not a fully-specified group name.  One
is comparing the hierarchy ROOT, not the names of groups therein.

>  The same goes for a lot of other checkgroups features!
> Besides, the patch totally breaks "checkgroups !hr.admin hr".

Which, as I understand it, is incorrect - as exclusion patterns must trail.

> > +# The hierarchy must match - so if "hierarchy.*" is specified, then
the
> > +# control message must have at least "Control: checkgroups hierarchy."
> > +# A trailing asterisk would be optional.  A trailing period is
required.
>
> A mandatory trailing period?  But it violates RFC 5537 (USEPRO)...

My comment is with regard to how the change parses, and what it needs to
parse.  If that's inconsistent with the standards, then we still need to
adjust it.  If a trailing asterisk is required under USEPRO, then this
still works.  If a trailing ".*" is absent, then we need to add at least
the period internally (if not the asterisk as well) to make the match work.

> > It is my opinion that if a pattern was specified in
> > control.ctl, then a checkgroups message should only be processed if at
> > least one group in the pattern matched a line in the message (meaning
that
> > there is [at least] one group that matches).
>
> Not only.  It should also be processed if a group is matched in your
> own active file, even though there is no match in the checkgroups.
> (Note that this behaviour is currently not done for "mail" and "log",
> which is a bug.)

 If there's no match between control.ctl and the checkgroups messages, it's
operating on nothing, so I don't see how the active file comes into play.
Are you saying that a "checkgroups 'NULL'" should remove everything?

> > I also noted something strange:  "If $#newbody >=0" - Should the equals
> > case really be there?  Without the above modification (pending),
#newbody
> > can only be zero if ALL lines in the message were excluded by
> > $exclusionpats or $droppats.  Would a checkgroups message be sent for
an
> > EMPTY hierarchy?
>
> $#newbody is the last *index* of an array (not its length).  So when it
is 0,
> it means that there is *one* newsgroup in the array.  It is not an empty
> hierarchy.

I thought it was a scalar count of elements in the array (thus one more in
value).

> Note that "$#output > 0" is used afterwards because I can have a blank
> empty line at the beginning of the docheckgroups output.
>
>
> > (That's the only case I can think of where this could be
> > legitimate - to remove all groups of a hierarchy going defunct.)
>
> And also newsgroups you should not have (in a sub-hierarchy for instance,
> or dropped by previous entries in control.ctl).
>
>
> > My original post effectively questioned whether this is
> > appropriate for a "log" operation, because it appears to generate
erroneous
> > log entries.
>
> It depends on what you call "erroneous".  The logs are quite valid (and
will
> resolve to "no change" in case you process them).
> INN 2.4 writes the same logs (but only once, for the last matching line
> in control.ctl).

That's the problem.  It's not writing once.  It's writing once per
"all:..." line form control.ctl, so with multiple lines, there are multiple
copies of the entire checkgroups message in the resulting log file(s),
INCLUDING lines which specify groups/hierarchies which are absent from the
checkgroups message itself.

The sample line given (hierarchy[1-4].*) and the sample hierarchy5.*
checkgroups message GENERATES a log entry, when the semantics tell a human
viewer that there is a null mathematical intersection between hierarchies
1-4 and 5, and thus nothing should result.  Having a log entry when none is
expected is therefore erroneous, and that's what I'm suggesting we correct.

When a pattern line excludes ALL of the groups in a checkgroups message, it
should NOT cause a log entry.  It should log (or perform the docheckgroups
function) only when something does match.

When a checkgroups message specifies the hierarchy pattern(as the first
parameter), I don't see why we shouldn't use that information to limit
which lines in control.ctl should be used.  After all, as implemented, the
third parameter from each control.ctl line is a matching pattern to the
first parameter of the control message.  For newgroup/rmgroup, they are
group names, but for checkgroups, it's the hierarchy name pattern (or name
root, with a trailing ".*" missing), not individual group names.  "Apples &
oranges."

I think that what you're telling me is that the process is comparing the
lines against individual groups filtering the contents of the checkgroups
message, but the problem is that when NOTHING matches, it's still executing
the action from control.ctl.  That's why it's wrong.  Where there's no
match, nothing should be done.

The suggested patch from yesterday takes advantage of the specified
hierarchy name pattern as match criteria against patterns in control.ctl.
Not "apples & oranges."  However, it is not where the problem is, as that
only limits when the hierarchy name is given.  Many checkgroups messages
seem to omit it, and thus that patch does nothing in such a case.

I haven't written an actual patch yet, but the procedure will be to set a
flag (or count) when there is at least one matching group in the
checkgroups message vs. each line from control.ctl it's being matched
against, and execute the action ONLY when the flag is true (or count is
nonzero).


Perhaps you're unaware of the problem I'm seeing.  I have lists of lines in
control.ctl that match groups that have:  hierarchies which are defunct,
private, or presumed private that aren't in the ISC version of control.ctl,
groups that have capital letters in them, and groups which have certain
"revenge" patterns in them.  I have about 20+ such lines in total.
Therefore, for every checkgroups that comes in, I'm getting 20+ copies of
the message across various log files because all of the filters for these
abusive group names start "all:*:..."  -- and that itself is an abuse,
especially when the message is for a valid hierarchy that also happens to
match its hierarchy-specific checkgroups statement (and does a
docheckgroups() based on that).  Checkgroups doesn't match the "last" line;
as implemented, it matches ALL lines from control.ctl (with a matching
message sender), such being contrary to "Lines are matched in order and the
last matching line in the file will be used" (from the manual page).
Matching all lines isn't matching just the last.

> > "docheckgroups will only check newsgroups in the top-level hierarchies
> > which are present in the checkgroups [message]."
> >
> > So, if NO groups are listed (because #newbody == zero) meaning that the
> > filtered body is empty, why are we still calling docheckgroups() for
> > processing?
>
> To remove unwanted newsgroups (dropped "*binaries*" or something like
that
> -- see the EXAMPLES section).
>
> It is what we really should do but as it appears to be trickier than
> I thought, docheckgroups() will currently returns nothing because of:
>
> ##  Exit if there is no matching newsgroup (otherwise docheckgroups is
eager
> ##  to delete everything).
> test -s ${T}/$$msg || {
>     rm -f ${T}/$$*
>     exit 0
> }
>
> But the logic is still here in controlchan and I plan on adding this new
> feature later.
>
>
> > Also, in readctlfile(), could we simplify the resulting regex
expressions?
> > Consider adding these two addtional expressions: s/\.\*\$//   and
> > s/\^\.\*//   That is, remove wildcarded anchor points.
>
> Maybe, provided that it does not break something afterwards (sed, awk,
grep
> or Perl).

What I suggested there is simply eliminating leading "^.*" and trailing
".*$" since they are useless.  A wildcard next to an anchor is senseless.

Technical Details
Message-ID: <h025go$vin$1@aux.snarked.org>
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.ams.giganews.com!nntp.giganews.com!news.musoftware.de!wum.musoftware.de!feeder.erje.net!news.snarked.org!not-for-mail
References: <gvpshs$7c4$1@aux.snarked.org> <gvqsba$6o2$1@news.trigofacile.com> <gvsgbm$gfm$1@aux.snarked.org> <gvtjcl$nmf$1@news.trigofacile.com> <gvut8f$l3m$1@aux.snarked.org> <gvv0ha$21b$1@news.trigofacile.com> <gvv6uq$mvv$1@aux.snarked.org> <h004v2$4d1$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <h025go$vin$1@aux.snarked.org>
Subject: Re: Another INN 2.5.0 rc2 bug - control.ctl processing
Date: Mon, 1 Jun 2009 20:15:34 -0700
From: "D. Stussy" <spam@bde-arc.ampr.org>
References: <gvpshs$7c4$1@aux.snarked.org> <gvqsba$6o2$1@news.trigofacile.com> <gvsgbm$gfm$1@aux.snarked.org> <gvtjcl$nmf$1@news.trigofacile.com> <gvut8f$l3m$1@aux.snarked.org> <gvv0ha$21b$1@news.trigofacile.com> <gvv6uq$mvv$1@aux.snarked.org> <h004v2$4d1$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.ams.giganews.com!nntp.giganews.com!news.musoftware.de!wum.musoftware.de!feeder.erje.net!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 220
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
NNTP-Posting-Host: pool-71-106-211-188.lsanca.dsl-w.verizon.net
X-Trace: aux.snarked.org 1243912536 32343 71.106.211.188 (2 Jun 2009 03:15:36
 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Tue, 2 Jun 2009 03:15:36 +0000 (UTC)
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478