🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81181

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

#81181
From: Julien ÉLIE
Date: Mon, 01 Jun 2009 08:53
128 lines
6313 bytes
Hi D. Stussy,

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


> 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.  The same goes for a lot of other checkgroups features!

Besides, the patch totally breaks "checkgroups !hr.admin hr".


> +# 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)...


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


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

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


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

-- 
Julien ÉLIE

« -- Et souvenez-vous ! La seule chose que nous ayons à craindre,
  c'est que le ciel nous tombe sur la tête !
  -- ...Et souvenez-vous, Romains, la seule chose que nous ayons
  à craindre, c'est les Gaulois ! » (Astérix) 
Technical Details
Message-ID: <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!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!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>

Show Full Headers
Complete Article Headers
Message-ID: <h004v2$4d1$1@news.trigofacile.com>
Subject: Re: Another INN 2.5.0 rc2 bug - control.ctl processing
Date: Mon, 1 Jun 2009 10:53:52 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
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>
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!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 128
NNTP-Posting-Host: aaubervilliers-151-1-45-218.w83-114.abo.wanadoo.fr
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252";
 reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: news.trigofacile.com 1243846434 4513 83.114.135.218 (1 Jun 2009
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Mon, 1 Jun 2009 08:53:54 +0000 (UTC)
In-Reply-To: <gvv6uq$mvv$1@aux.snarked.org>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049