πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81237

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

#81237
From: D. Stussy
Date: Thu, 04 Jun 2009 03:32
183 lines
9296 bytes
"Julien Γ‰LIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:h06c9j$tv7$1@news.trigofacile.com...
> >>> Well , if the pattern were "all:*:hierarchy1.*|*a*:log=...", then
> >>> "hierarchy5.*" would match, so I don't see a problem.
> >>
> >> It was just an example for "*a*"...  Then consider "*z*".
> >
> > Then a checkgroups for "hierarchy5.*" groups would NOT match *z*, yet
> > copying the message to a log file would still occur.  That is wrong.
No
> > matching groups means that the action should not occur.
>
> I think you and I keep telling the same thing :)
> But in case I was not clear enough, the pattern in control.ctl matches
> newsgroup names (*every* line of a checkgroups) and not the first
component
> of a hierarchy.
>
> I understood your wish for the "log" action in checkgroups and
> I will try to address it.

See if my patch for the counter does so.

> >> chkscope            = 1*( 1*WSP ["!"] newsgroup-name )
> >
> > The BNF syntax doesn't show it, but logically, one cannot have a
"negative
> > hierarchy."
>
> Neither does the paragraph below the BNF syntax.
> It is not "logical" to assume "+" will come before "-".  It is
commutative.
>
> > The BNF may describe "checkgroups !hr.admin hr" as
> > syntactically correct, but it is semantically wrong.  I would read it
as
> > covering all of "hr.*" INCLUDING "hr.admin"(.*) since the negation is
> > overridden by a subsequent pattern that reincludes it and is thusly
> > ignored.  Multiple patterns are applied left to right in order of
> > occurance.
>
> You would read it like that, OK, but you would not be compliant with
> RFC 5537.
> Just take the checkgroups, remove hr.admin.* and then keep hr.*; it
> is the same as taking the checkgroups, keeping hr.* and then removing
> hr.admin.* (grep commutativity).
>
>   ** Do not mix up RFC 3977 where the rightmost pattern matches in
>      NNTP wildmats and RFC 5537 where it is not the case. **

The syntax may be commutative, but the SEMANTICS of the operations are not.

To exclude (and make sense), one first must have a non-empty set that is
included.  Should the exclusion be encountered first, one empties from an
already empty set, and therefore the operation effectively does nothing.

Exclusion is like subtraction:  It LACKS the commutative property.  Order
is important.

Now, if RFC 5537 (number assigned; not yet published) will state that the
terms are ordered from superset to subset, fine.  However,
http://www.rfc-editor.org/internet-drafts/draft-spencer-usefor-son-of-1036-00.txt
(May 2009) does NOT make such an assertion.  Therefore, I see no reason why
left-to-right (i.e. order the parameters are encountered) is not the
natural processing order.  However, it also seems that this latest draft
indicates that the "checkgroups" control message takes NO parameters.
Exclusions (called "invalidations") appear now in the body of the message.
Our current implementation cannot handle that:

--------------------------
Internet-Draft            Son of 1036               3 May 2009      [Page
64]

7.6.  checkgroups

   The checkgroups control message contains a supposedly authoritative
   list of the valid newsgroups within some subset of the newsgroup name
   space:

      checkgroups-arguments  =
      checkgroups-body       = [ invalidation ] valid-groups
                             / invalidation
      invalidation           = "!" plain-component
                               *( "," plain-component ) eol
      valid-groups           = 1*( description-line eol )

   There are no arguments.  The body lines (except possibly for an
   initial invalidation) each contain a description line for a
   newsgroup, as defined under the newgroup message (section 7.3).
--------------------------

> > @@ -37,6 +38,7 @@
> >         my $charset_newsgroup = $charset_message;
> >
> >         next if ($ngname =~ /$exclusionpats/ or $ngname =~
/$droppats/);
> > +        $counter++ if ($ngname =~ /$newsgrouppats/);
> >
> >         # Find the right charset if absent or forced by control.ctl.
> >         foreach (@$charset_from) {
>
> Hmm...  Why not
>
> +         next if ($ngname !~ /$newsgrouppats/);
>
> instead of the counter?  This way, we could use @newbody and not execute
> the rest of the function if @newbody is empty.
>
> Wouldn't it fix your issue?

Not necessarily.  As I noted, if there is any body text not part of a group
listing (like a descriptive paragraph at the top meant for people), then
this will NOT be the same.  Any such text (if allowed) would be removed and
not survive to the included in the 'action = mail' operation that follows.
However, if the standards guarente that there won't be any extra text in
the message body, and we don't care to have a counter of groups found in
the message, then so be it.

Note:  I believe that with the current implementation, the extra text
includes the message headers, so it will never be null, yet will get
filtered out.

> HOWEVER, if we do that, as I already told you, there is the problem
> of the active file to deal with.
> Because if you have in your active file:
>
> foo.bar.misc
> foo.test
>
> and that you receive the following checkgroups:
>
> foo.admin    Admin group.
> foo.test     Test group.
>
> and have the following control.ctl line:
>
> checkgroups:*:foo.bar.*:log=ignore
>
> the checkgroups will NOT be logged any longer in your log file and
> therefore you will NEVER know that foo.bar.misc has been removed.

Would it have been logged before the change?  "foo.bar.misc" is absent from
the checkgroups message, so the group filter results in a NULL set for the
log command.  Therefore, what gets logged is the original message.
However, that's not the step that actually removes it.  When a different
control.ctl line (one matching "foo.*") is found, that's the line that
causes the removal operation to happen, and as such, Although this won't
appear in "...log/ignore" with the change, its removal WILL APPEAR in the
output as a result of the operation specifying "foo.*" as its group filter.

Therefore, if we have:

checkgroups:*:hierarchy.*:log=a
checkgroups:*:hierarchy.sub.*:log=b

Then checkgroups messages that remove ALL of "hierarchy.sub.*" from
"hierarchy.*" will only appear in logfile "a".

Without the change, we would log a checkgroups message to logfile "b" that
contains NO groups matching "hierarchy.sub.*" -- INCLUDING messages that
are checkgroups for hierarchies OTHER than "hierarchy.*" (which would thus
never include "hierarchy.sub.*" and therefore are irrelevant to the status
of the subhierarchy).  I'm not for filling a log file with garbage that
doesn't pertain to the purpose of the file.  A checkgroups message for
hierarchy "local.*" (e.g.) has no business being recorded in log file "b"
as "local.*" never includes "hierarchy.sub.*", yet it will be.

With the change, I don't see not logging the removal of all groups matching
"hierarchy.sub.*" in log file "b" as an issue.  "hierarchy.sub.*" no longer
exists, and its removal IS logged in "a" (or as a part of another action
operation for "hierarchy.*" as appropriate).  Basically, as far as one is
concerned, one received a checkgroups message that is EMPTY with regard to
"hierarchy.sub.*", so if the message pertained only to that sub-hierarchy,
it would have a EMPTY BODY, so what is there to log?  There are no groups
that match the pattern, so why shouldn't the line be ineffective?

Is it even possible to send a checkgroups message for an empty hierarchy?

The way I see things, one can reduce a top-level hierarchy down to a single
group via checkgroups, but then an rmgroup message must be used to remove
that final group.

Technical Details
Message-ID: <h07f8m$g3t$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!news.alt.net!news-xfer.nntp.sonic.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> <h025go$vin$1@aux.snarked.org> <h02hfe$bki$1@news.trigofacile.com> <h04a6c$44k$1@aux.snarked.org> <h06c9j$tv7$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <h07f8m$g3t$1@aux.snarked.org>
Subject: Re: Another INN 2.5.0 rc2 bug - control.ctl processing
Date: Wed, 3 Jun 2009 20:32:39 -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> <h025go$vin$1@aux.snarked.org> <h02hfe$bki$1@news.trigofacile.com> <h04a6c$44k$1@aux.snarked.org> <h06c9j$tv7$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!news.alt.net!news-xfer.nntp.sonic.net!news.snarked.org!not-for-mail
Newsgroups: news.software.nntp
Lines: 183
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 1244086359 16509 71.106.211.188 (4 Jun 2009 03:32:39
 GMT)
X-Complaints-To: newsmaster@snarked.org
NNTP-Posting-Date: Thu, 4 Jun 2009 03:32:39 +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