πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81173

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

#81173
From: D. Stussy
Date: Mon, 01 Jun 2009 00:21
155 lines
7930 bytes
"Julien Γ‰LIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gvv0ha$21b$1@news.trigofacile.com...
> Hi D. Stussy,
> >> Please read the EXAMPLES section in the same man page.
> >> You will see that there are *5* actions done for:
> >>
> >>     checkgroups:foo@bar.com:foo.*:verify-key-foo
> >>     checkgroups:foo@bar.com:foo.bar2.*:doit
> >>     checkgroups:foo@bar.com:foo.bar3.*:mail
> >>     checkgroups:foo@bar.com:foo.bar4|foo.bar4.*:doit
> >>     checkgroups:foo@bar.com:foo.bar5|foo.bar5.*:drop
> >>
> >> It is the same if you put X copies af "all" with a log action.
> >
> > So, for each of my "log=ignore" lines, when a checkgroups comes it, it
will
> > MATCH all of those lines?  It will also extract all of the groups
matched
> > (e.g. for "hr.*", this will be a null set) and feed that to
checkgroups?
> > Therefore, since the hierarchy of the checkgroups didn't match, it
> > "processed" a NULL checkgroups message for each line?
>
> You are using "log" so nothing is processed and the whole checkgroups
> is written to the log file.
>
>
> > That is clearly not what was expected.  I would expect that if the
> > resulting checkgroups group (sub-)set that matches is NULL, it would
NOT
> > match and therefore NOT be recorded into the log file(s).
>
> Logging means a manual inspection afterwards.
>
> Consider that you have in your active file:
>
> foo.bar.misc
> foo.test
>
> and that you receive the following checkgroups:
>
> foo.admin
> foo.test
>
> with the following control.ctl line:
>
> checkgroups:*:foo.bar.*:log=ignore
>
> Then, according to what you want (NO match and NO record), how will
> you be aware that you have an obsolete newsgroup, namely foo.bar.misc?
>
> You are using the "log" option; it is for manual inspection and you
> want to discard possibly useful information.  Fine, but as I told you,
> you have to come up with a better algorithm which handles the edge case
> I suggest here.
> (And I can write 14 lines for foo.bar1.* ... foo.bar14.*, all of them
> with "log=ignore".)
>
> How could I handle that?

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.

If the control line was:

  Control:  checkgroups hierarchy5.*

then see my comments in the last paragraph and the PATCH that follows.

Control:  checkgroups    (no hierarchy specified)

This is trickier and needs to be handled in checkgroups.pl itself.  I'm
working on it.  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).  So far, I think that the
right place for this is in the "foreach(@body)" loop.  I'm thinking of
counting the lines for all lines where the desired pattern matched (or
setting a boolean flag to true) - so we know at least one group of the
pattern was found.

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?  (That's the only case I can think of where this could be
legitimate - to remove all groups of a hierarchy going defunct.)  This is
OK for the "mail" operation, but I question if a "docheckgroups" program
should be sent a message when the include-pattern is absent from the
message.  My original post effectively questioned whether this is
appropriate for a "log" operation, because it appears to generate erroneous
log entries.

  "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?  ...Especially if the reason for calling docheckgroups() is
based on a line from control.ctl (or .local) which listed OTHER
hierarchies?  I don't think that checkgroups processing can operate on an
empty hierarchy and understand which hierarchy is to be emptied when it is
NOT specified in the "Control:" header.  Perhaps that requires specifying a
dummy group name in the hierarchy that is invalid and thus will not be
added.

Unfortunately, I have to go to a meeting and will have to finish this
later.

Meanwhile, while looking into this, I have figured out a one line hack in
controlchan.in to limit checkgroups matches to the hierarchy (if any) that
is named on the "Control:" header line (as the first parameter).  Here it
is:
--- controlchan.in 2009-05-31 23:29:34.000000000 +0000
+++ controlchan.in.mod 2009-06-01 00:07:33.000000000 +0000
@@ -328,8 +328,20 @@
                 $action =~ s/\^(.+)\$/$1/;
                 $action =~ s/\\//g;
                 ($action, $logname) = split(/=/, $action);
+#
+# Comment:  Modification by D. Stussy, 2009/05/31  ("If" clause)
+# If "checkgroups" specified a hierarchy name, match only if the hierarchy
is
+# also listed on the control.ctl line.  Assumes "hierarchy.*" entries.
+# Previously, "checkgroups" would match all lines regardless of groups.
+# This part requires that the checkgroups command specify a hierarchy
name.
+# Unfortunately, that parameter is optional - and may not itself be a
pattern.
+# 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.
+#
                 if ($type eq 'checkgroups') {
-                    push (@$matches, [ $action, $logname, $ctlline[2] ]);
+                    push (@$matches, [ $action, $logname, $ctlline[2] ])
+                        if (!$newsgroup || $newsgroup =~ /$ctlline[2]/);
                 } else {
                     push (@$matches, [ $action, $logname, undef ]);
                     # @ctllist is a reversed list so the first match is
the last

-------
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.


Technical Details
Message-ID: <gvv6uq$mvv$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.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!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>

Show Full Headers
Complete Article Headers
Message-ID: <gvv6uq$mvv$1@aux.snarked.org>
Subject: Re: Another INN 2.5.0 rc2 bug - control.ctl processing
Date: Sun, 31 May 2009 17:21:47 -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>
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.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!news.albasani.net!feeder.erje.net!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 155
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 1243815707 23551 71.106.211.188 (1 Jun 2009 00:21:47
 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Mon, 1 Jun 2009 00:21:47 +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