🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
26 messages
26 total messages Started by D. Stussy Fri, 29 May 2009 23:53
Another INN 2.5.0 rc2 bug - control.ctl processing
#81124
Author: D. Stussy
Date: Fri, 29 May 2009 23:53
24 lines
2144 bytes
A separate issue than the above, but dealing with the same data:
control.ctl.

Manual page for "control.ctl"

"If the control message is a newgroup or rmgroup, the third field,
<newsgroups>, is a shell-style pattern matching the  newsgroup affected by
the control message (especially "?" matches exactly one character, "*"
matches zero or more characters and "|" permits to match several patterns
on the same line -- for instance "comp.*|humanities.*"  matches every
newsgroup whose name begins with "comp." or "humanities.").  If the control
message is a checkgroups, the third field is a shell-style pattern matching
the newsgroups that should be processed for checking.  If the control
message is of any other type, the third field is ignored."

If the control message is of type "all", the third field should be matched,
not ignored.

This would be useful for protecting the specially named hierarchies
(control.*, to.*, local.*), defunct hierarchies, private hierarchies, and
the default rules.  Otherwise, one has to repeat each rule three times (for
newgroup, rmgroup, and checkgroups).

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81135
Author: Julien ÉLIE
Date: Sat, 30 May 2009 08:56
41 lines
2877 bytes
Hi D. Stussy,

> "If the control message is a newgroup or rmgroup, the third field,
> <newsgroups>, is a shell-style pattern matching the  newsgroup affected by
> the control message (especially "?" matches exactly one character, "*"
> matches zero or more characters and "|" permits to match several patterns
> on the same line -- for instance "comp.*|humanities.*"  matches every
> newsgroup whose name begins with "comp." or "humanities.").  If the control
> message is a checkgroups, the third field is a shell-style pattern matching
> the newsgroups that should be processed for checking.  If the control
> message is of any other type, the third field is ignored."
>
> If the control message is of type "all", the third field should be matched,
> not ignored.

The third field is currently matched for "all".
"all" is not a control message type; it matches every control message and
applies to all of them.


> This would be useful for protecting the specially named hierarchies
> (control.*, to.*, local.*), defunct hierarchies, private hierarchies, and
> the default rules.  Otherwise, one has to repeat each rule three times (for
> newgroup, rmgroup, and checkgroups).

I have just tested:

newgroup:test@test:local.test:mail
all:*:local.*:drop

A newgroup article for local.test is properly dropped.

I do not understand what you would want.  Only a documentation issue?  Then,
what should be added and where?

-- 
Julien ÉLIE

« -- Prends un peu de potion magique, Jolitorax ?
  -- Mais ça va être l'heure de l'eau chaude ! » (Astérix) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81134
Author: Julien ÉLIE
Date: Sat, 30 May 2009 09:03
21 lines
2032 bytes
>> This would be useful for protecting the specially named hierarchies
>> (control.*, to.*, local.*), defunct hierarchies, private hierarchies, and
>> the default rules.  Otherwise, one has to repeat each rule three times (for
>> newgroup, rmgroup, and checkgroups).
>
> I have just tested:
>
> newgroup:test@test:local.test:mail
> all:*:local.*:drop
>
> A newgroup article for local.test is properly dropped.

And of course a newgroup article for fr.test is not dropped (and handled by
previous lines in control.ctl).

-- 
Julien ÉLIE

« Il y a des sciences bonnes dont l'existence est nécessaire
  et dont la culture est inutile. Telles sont les mathématiques. » (Joseph Joubert)
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81143
Author: D. Stussy
Date: Sat, 30 May 2009 23:43
76 lines
4171 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gvqsba$6o2$1@news.trigofacile.com...
> > "If the control message is a newgroup or rmgroup, the third field,
> > <newsgroups>, is a shell-style pattern matching the  newsgroup affected
by
> > the control message (especially "?" matches exactly one character, "*"
> > matches zero or more characters and "|" permits to match several
patterns
> > on the same line -- for instance "comp.*|humanities.*"  matches every
> > newsgroup whose name begins with "comp." or "humanities.").  If the
control
> > message is a checkgroups, the third field is a shell-style pattern
matching
> > the newsgroups that should be processed for checking.  If the control
> > message is of any other type, the third field is ignored."
> >
> > If the control message is of type "all", the third field should be
matched,
> > not ignored.
>
> The third field is currently matched for "all".
> "all" is not a control message type; it matches every control message and
> applies to all of them.

Are we certain it's being matched?  The behavior I see implies it's being
ignored.

I have lines like the following (which is real) from control.ctl.local:

all:*:acay.*|air.*|alive.*|alot.*|america.*|apc.*|au.*|betanews.*:log=defun
ct

When the recent "checkgroups hr.*" came in, I got "X" copies of it into my
"~news/log/defunct" file, where X is the number of lines like the above
one.  I also got it for similar lines of hierarchies that I map to
"...log/private" and "...log/presumed" (hierarchies presumed to be
private), one for each line of groups in control.ctl.local.  That implies
to me that "all" is ignoring the group-matching parameter of these lines.

In contrast, with respect to the line:

newgroup:*:h[0-9a-z]pc[lr][0-9a-z]me|cr[0-9a-z]meh[0-9a-z]p|*eijk*:log=igno
red

The checkgroups message did NOT end up in the "...log/ignored" file - since
newgroup does check parameter #3 for group names.

> > This would be useful for protecting the specially named hierarchies
> > (control.*, to.*, local.*), defunct hierarchies, private hierarchies,
and
> > the default rules.  Otherwise, one has to repeat each rule three times
(for
> > newgroup, rmgroup, and checkgroups).
>
> I have just tested:
>
> newgroup:test@test:local.test:mail
> all:*:local.*:drop
>
> A newgroup article for local.test is properly dropped.
>
> I do not understand what you would want.  Only a documentation issue?
Then,
> what should be added and where?

Not just a documentation issue.  "all:*:group1.*|group2.*:log=somewhere"
needs to honor the group list because it includes the 3 ".*groups?"
operators.  I believe that the documented behavior is wrong.  As written,
"all" ignores the group string, and that's what I'm seeing, but when all is
applied against the 3 group operators, the group list should be recognized.
Currently, it's not.

Please test it again, this time specifying multiple hierarchies separated
by "|" and see if it works or fails.

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81148
Author: Julien ÉLIE
Date: Sun, 31 May 2009 09:41
97 lines
4901 bytes
Hi D. Stussy,

>> The third field is currently matched for "all".
>> "all" is not a control message type; it matches every control message and
>> applies to all of them.
>
> Are we certain it's being matched?

Yes.


> The behavior I see implies it's being ignored.
>
> I have lines like the following (which is real) from control.ctl.local:
>
> all:*:acay.*|air.*|alive.*|alot.*|america.*|apc.*|au.*|betanews.*:log=defunct
>
> When the recent "checkgroups hr.*" came in, I got "X" copies of it into my
> "~news/log/defunct" file, where X is the number of lines like the above
> one.  I also got it for similar lines of hierarchies that I map to
> "...log/private" and "...log/presumed" (hierarchies presumed to be
> private), one for each line of groups in control.ctl.local.

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.


> That implies
> to me that "all" is ignoring the group-matching parameter of these lines.

The group-matching parameter is not ignored at all.  Only the newsgroups
matching your lines would have been extracted from the checkgroups (had you
used something like "mail" or "doit").


> In contrast, with respect to the line:
>
> newgroup:*:h[0-9a-z]pc[lr][0-9a-z]me|cr[0-9a-z]meh[0-9a-z]p|*eijk*:log=ignored
>
> The checkgroups message did NOT end up in the "...log/ignored" file - since
> newgroup does check parameter #3 for group names.

A newgroup control article matches only *one* line.  If it does not match
this one, no action is done.


>> I do not understand what you would want.  Only a documentation issue?
>> Then, what should be added and where?
>
> Not just a documentation issue.  "all:*:group1.*|group2.*:log=somewhere"
> needs to honor the group list because it includes the 3 ".*groups?"
> operators.  I believe that the documented behavior is wrong.  As written,
> "all" ignores the group string, and that's what I'm seeing, but when all is
> applied against the 3 group operators, the group list should be recognized.
> Currently, it's not.
>
> Please test it again, this time specifying multiple hierarchies separated
> by "|" and see if it works or fails.

I have tested and the behaviour is correct:  the third field is honoured,
even with multiple patterns.
Checkgroups work differently than other control messages.

    checkgroups:*:acay.*:log=defunct

As it is "*" for the sender, the line matches.  Then we extract all lines
containing "acay.*" in the checkgroups and process the message.

Please note that the behaviour is the same if for instance you specify
something like:

    checkgroups:*:*a*:log=defunct

which only takes into account newsgroups containing the letter "a".
The message is processed.

We need a generic parsing in order to handle all possible edge cases
with checkgroups.
If you have a better algorithm than what is currently implemented,
feel free to tell.  (And I recall you that neither checkgroups scopes
nor serial numbers are implemented in INN 2.5.0.  They are new features
of RFC 5537 [USEPRO].)

-- 
Julien ÉLIE

« Quae longo tempore extenuentur corpora,
  lente reficere oportet. » (Hippocrate)
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81170
Author: D. Stussy
Date: Sun, 31 May 2009 21:36
125 lines
5812 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:gvtjcl$nmf$1@news.trigofacile.com...
> >> The third field is currently matched for "all".
> >> "all" is not a control message type; it matches every control message
and
> >> applies to all of them.
> >
> > Are we certain it's being matched?
>
> Yes.
>
>
> > The behavior I see implies it's being ignored.
> >
> > I have lines like the following (which is real) from control.ctl.local:
> >
> >
all:*:acay.*|air.*|alive.*|alot.*|america.*|apc.*|au.*|betanews.*:log=defun
ct
> >
> > When the recent "checkgroups hr.*" came in, I got "X" copies of it into
my
> > "~news/log/defunct" file, where X is the number of lines like the above
> > one.  I also got it for similar lines of hierarchies that I map to
> > "...log/private" and "...log/presumed" (hierarchies presumed to be
> > private), one for each line of groups in control.ctl.local.
>
> 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?  And since I have
"all:...:log=ignore" lines 14 times in my control.ctl.local file, that's
why the "hr.*" checkgroups message appears 14 times in ".../log/ignored"?

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).  NULL should not
match "*".

> > That implies
> > to me that "all" is ignoring the group-matching parameter of these
lines.
>
> The group-matching parameter is not ignored at all.  Only the newsgroups
> matching your lines would have been extracted from the checkgroups (had
you
> used something like "mail" or "doit").
>
>
> > In contrast, with respect to the line:
> >
> >
newgroup:*:h[0-9a-z]pc[lr][0-9a-z]me|cr[0-9a-z]meh[0-9a-z]p|*eijk*:log=igno
red
> >
> > The checkgroups message did NOT end up in the "...log/ignored" file -
since
> > newgroup does check parameter #3 for group names.
>
> A newgroup control article matches only *one* line.  If it does not match
> this one, no action is done.
>
>
> >> I do not understand what you would want.  Only a documentation issue?
> >> Then, what should be added and where?
> >
> > Not just a documentation issue.
"all:*:group1.*|group2.*:log=somewhere"
> > needs to honor the group list because it includes the 3 ".*groups?"
> > operators.  I believe that the documented behavior is wrong.  As
written,
> > "all" ignores the group string, and that's what I'm seeing, but when
all is
> > applied against the 3 group operators, the group list should be
recognized.
> > Currently, it's not.
> >
> > Please test it again, this time specifying multiple hierarchies
separated
> > by "|" and see if it works or fails.
>
> I have tested and the behaviour is correct:  the third field is honoured,
> even with multiple patterns.
> Checkgroups work differently than other control messages.
>
>     checkgroups:*:acay.*:log=defunct
>
> As it is "*" for the sender, the line matches.  Then we extract all lines
> containing "acay.*" in the checkgroups and process the message.
>
> Please note that the behaviour is the same if for instance you specify
> something like:
>
>     checkgroups:*:*a*:log=defunct
>
> which only takes into account newsgroups containing the letter "a".
> The message is processed.
>
> We need a generic parsing in order to handle all possible edge cases
> with checkgroups.
> If you have a better algorithm than what is currently implemented,
> feel free to tell.  (And I recall you that neither checkgroups scopes
> nor serial numbers are implemented in INN 2.5.0.  They are new features
> of RFC 5537 [USEPRO].)
>
> -- 
> Julien ÉLIE
>
> « Quae longo tempore extenuentur corpora,
>   lente reficere oportet. » (Hippocrate)
>

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81172
Author: Julien ÉLIE
Date: Sun, 31 May 2009 22:32
60 lines
3404 bytes
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?

-- 
Julien ÉLIE

« Ad iura renunciata, non datur regressus. » 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81173
Author: 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.


Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81181
Author: 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) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81182
Author: Julien ÉLIE
Date: Mon, 01 Jun 2009 09:24
29 lines
2408 bytes
Hi D. Stussy,

> 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).  NULL should not
> match "*".

If you are not satisfied with the current behaviour for LOG with an EMPTY
matching checkgroups, then use in checkgroups.pl:

        if ($log) {
            # The checkgroups is written unprocessed (@body and not @newbody).
-            logger($log, "checkgroups by $sender", $article);
+            logger($log, "checkgroups by $sender", $article)
+                if $#newbody >= 0;
        } else {
            logmsg("checkgroups by $sender");
        }


It is the quickest way to satisfy your needs (though, as I told you, you
could lose some useful information if you use a few particular patterns
but since you [currently] do not use them...).

-- 
Julien ÉLIE

« Bibere humanum est, ergo bibamus. »
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81189
Author: 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.

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81191
Author: Julien ÉLIE
Date: Tue, 02 Jun 2009 06:39
66 lines
4278 bytes
Hi D. Stussy,

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


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

We're applying the pattern at the group name level here, as said in the
documentation.  Not at the top hierarchy level.

  "If the control message is a checkgroups, the third field is a shell-style
  pattern matching the newsgroups that should be processed for checking."


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

Where do you see that exclusion patterns *must* trail?!?

      control-command     =/ Checkgroup-command
      Checkgroup-command  = "checkgroups" Checkgroup-arguments
      Checkgroup-arguments= [ chkscope ] [ chksernr ]
      chkscope            = 1*( 1*WSP ["!"] newsgroup-name )
      chksernr            = 1*WSP "#" 1*DIGIT


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

I understand that point.  Note that nothing is currently done (except when
the action is "log" -- and it is something I will try to improve).


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

I think you are skipping the last part of the sentence...
which is present in INN 2.5.0 rc2 (according to the subject of your thread):

  http://www.eyrie.org/~eagle/software/inn/docs/control.ctl.html

    "Lines are matched in order and the last matching line in the file will
    be used, except for checkgroups messages which are handled differently
    (every matching line is used)."

-- 
Julien ÉLIE

« Dragon, rends-moi mes cornes ! » (le coq à l'aube) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81202
Author: D. Stussy
Date: Tue, 02 Jun 2009 22:47
158 lines
8009 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:h02hfe$bki$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.

 > >> "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.
>
> We're applying the pattern at the group name level here, as said in the
> documentation.  Not at the top hierarchy level.
>
>   "If the control message is a checkgroups, the third field is a
shell-style
>   pattern matching the newsgroups that should be processed for checking."
>
>
> >> 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.
>
> Where do you see that exclusion patterns *must* trail?!?
>
>       control-command     =/ Checkgroup-command
>       Checkgroup-command  = "checkgroups" Checkgroup-arguments
>       Checkgroup-arguments= [ chkscope ] [ chksernr ]
>       chkscope            = 1*( 1*WSP ["!"] newsgroup-name )
>       chksernr            = 1*WSP "#" 1*DIGIT

The BNF syntax doesn't show it, but logically, one cannot have a "negative
hierarchy."  Before one can have exclusions, one has to define from what
the exclusions apply to.  It's common sense.  As there is no "default
scope" (of groups, thus a NULL set), the scope must first include before it
can exclude.  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.

> > 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.
>
> I understand that point.  Note that nothing is currently done (except
when
> the action is "log" -- and it is something I will try to improve).

...And that's the problem I have.  Action "log=_logfile_" is being executed
for every NON-group-matching line in my control.ctl file(s).

That's why I suggested a flag or counter of matching lines.  One cannot use
"newbody" alone because it includes lines not excluded, which need not be
the same as matching lines.  Newbody may include text before the newsgroup
list (e.g. a paragraph describing what a checkgroups message is [*]), and
thus it could be not-null while also failing to have any line that matches
the inclusion pattern(s).  A malicious checkgroups message could include
out-of-hierarchy groups.

I would prefer a counter over a flag, because the count could be useful as
a verification datum after changes are applied.

* - Even if the standards forbid a descriptive text, the implementation
doesn't.

> > 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.
>
> I think you are skipping the last part of the sentence...
> which is present in INN 2.5.0 rc2 (according to the subject of your
thread):
>
>   http://www.eyrie.org/~eagle/software/inn/docs/control.ctl.html
>
>     "Lines are matched in order and the last matching line in the file
will
>     be used, except for checkgroups messages which are handled
differently
>     (every matching line is used)."

That URL does not mirror the manual page that I was seeing as installed as
part of the INN package for "control.ctl".  Apparently, my man program on
my backup machine was pulling up an older (from INN 2.4.5) version of the
page.  Therefore, I was acting under a different premise of the documented
behavior.  However, the bug is still there.

This means modifying control//modules/checkgroups.pl.  As long as we're
doing that, I wonder whether the correct default character set should be
"cp1252" as opposed to ASCII ("us-ascii") or UTF-8.

Forget the other patch.  I think adding a counter solves the issue:

--- checkgroups.pl 2009-04-25 14:50:23.000000000 +0000
+++ checkgroups.pl.mod 2009-06-02 22:44:46.000000000 +0000
@@ -26,6 +26,7 @@
     my @headers = split(/\r?\n/, $head->stringify);
     my @body = split(/\r?\n/, $article->stringify_body);
     my @newbody;
+    my $counter = 0;

     my $charset_message;
     if (defined $head->mime_attr('Content-Type.charset')) {
@@ -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) {
@@ -61,6 +63,7 @@
         Encode::from_to($ngdesc, $charset_newsgroup, $charset_to);
         push(@newbody, $ngname."\t".$ngdesc);
     }
+    return if ($counter < 1);

     if ($action eq 'mail' and $#newbody >= 0) {
         my $mail = sendmail("checkgroups by $sender");
@@ -75,7 +78,8 @@
 $INN::Config::pathbin/docheckgroups -u '$newsgrouppats' '$exclusionpats'
<<zRbJ
 END
         print $mail map { s/^~/~~/; "$_\n" } @newbody;
-        print $mail "zRbJ\n";
+        print $mail "zRbJ\n\n$counter group".(($counter != 1) ? 's' : '')
..
+     " listed.\n";
         close $mail or logdie("Cannot send mail: $!");
     } elsif ($action eq 'log') {
         if ($log) {

The last segment of the patch (line 75->78) is optional, but perhaps nice
for the "mail" operation to have the count of matching groups.

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81225
Author: Julien ÉLIE
Date: Wed, 03 Jun 2009 17:35
93 lines
4629 bytes
Hi D. Stussy,

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



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



> @@ -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?


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.

-- 
Julien ÉLIE

« Vous savez, les idées, elles sont dans l'air. Il suffit que quelqu'un
  vous en parle de trop près, pour que vous les attrapiez ! » (Raymond Devos) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81237
Author: 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.

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81248
Author: Urs Janßen
Date: Thu, 04 Jun 2009 10:57
12 lines
2168 bytes
In <h07f8m$g3t$1@aux.snarked.org>, D. Stussy wrote:
> 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

[draft-spencer-usefor-son-of-1036-00.txt]
|   It is being published now in order to provide the Historical
|   Background out of which those standards have grown. Present-day
|   implementors should be aware that it is NOT NOW APPROPRIATE for use
|   in current implementations.

but the upcoming RFC will be based on draft-ietf-usefor-usepro-14.txt
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81254
Author: Julien ÉLIE
Date: Thu, 04 Jun 2009 18:34
115 lines
6016 bytes
Hi D. Stussy,

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

  checkgroups hr !hr.admin #2009060401
  checkgroups !hr.admin hr #2009060401

are equivalent, as well as:

  cat checkgroups | grep "^hr" | grep -v "^hr\.admin"
  cat checkgroups | grep -v "^hr\.admin" | grep "^hr"


Do not forget that the syntax is:

      control-command     =/ Checkgroup-command
      Checkgroup-command  = "checkgroups" Checkgroup-arguments
      Checkgroup-arguments= [ chkscope ] [ chksernr ]
      chkscope            = 1*( 1*WSP ["!"] newsgroup-name )
      chksernr            = 1*WSP "#" 1*DIGIT

We can have "checkgroups" with no arguments.
Just consider that "checkgroups" means that we take *everything* (the
initial set).  Then we add/remove.


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

Such a text is NOT allowed.
There is no descriptive paragraph at the top (or bottom) of a checkgroups.

      checkgroups-body    = *( valid-group CRLF )
      valid-group         = newsgroups-line
      newsgroups-line     = newsgroup-name
                               [ 1*HTAB newsgroup-description ]
                               [ *WSP moderation-flag ]


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

The standard says that.  We then won't have to parse descriptive paragraphs.


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

Yes, the original message was logged before the change.  In log files,
only *whole* messages are logged and you could then have acted upon it.


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

Why wouldn't "foo.bar.*" not remove "foo.bar.defunct"?
If I only want the subhierarchy "foo.bar.*" (imagine "alt.fr.*" for French
people), I will process "foo.bar.*", not "foo.*" (the whole "alt.*").


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

That the sub-hierarchy is defunct.  You would otherwise never know
(see my previous example with "alt.fr.*" -- yeah I know that there aren't
any checkgroups for alt.* but that's just an example and I can do the
same for instance with "news.admin.*" only).


> There are no groups
> that match the pattern, so why shouldn't the line be ineffective?

Lines to remove in the newsgroups file, groups to remove from the active
file...


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

checkgroups-body    = *( valid-group CRLF )

Then, yes.  It is not "1*( valid-group CRLF )".


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

Not necessarily.  A checkgroups can be empty.

-- 
Julien ÉLIE

« Il paraît que lorsque l'on prête l'oreille, on entend mieux. C'est faux !
  Il m'est arrivé de prêter l'oreille à un sourd. Il n'entendait pas mieux. »
  (Raymond Devos) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81270
Author: D. Stussy
Date: Fri, 05 Jun 2009 07:06
152 lines
7262 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:h09440$hgr$1@news.trigofacile.com...
> > 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.
>
>   checkgroups hr !hr.admin #2009060401
>   checkgroups !hr.admin hr #2009060401
>
> are equivalent, as well as:
>
>   cat checkgroups | grep "^hr" | grep -v "^hr\.admin"
>   cat checkgroups | grep -v "^hr\.admin" | grep "^hr"
>
>
> Do not forget that the syntax is:
>
>       control-command     =/ Checkgroup-command
>       Checkgroup-command  = "checkgroups" Checkgroup-arguments
>       Checkgroup-arguments= [ chkscope ] [ chksernr ]
>       chkscope            = 1*( 1*WSP ["!"] newsgroup-name )
>       chksernr            = 1*WSP "#" 1*DIGIT
>
> We can have "checkgroups" with no arguments.
> Just consider that "checkgroups" means that we take *everything* (the
> initial set).  Then we add/remove.

You're reading into this an order that isn't [currently] stated.  I can
agree ONLY if there is an explicit ordering stated that indicates superset
through subset order, but no such order has been stated.

Are you certain that the default set is "everything" as opposed to nothing?
If so, then our first add won't add anything that's not already included,
just as if we started with nothing, an exclusion encountered first will
remove from nothing.  That doesn't get us anywhere.

> >> 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
>
> Such a text is NOT allowed.
> There is no descriptive paragraph at the top (or bottom) of a
checkgroups.
>
>       checkgroups-body    = *( valid-group CRLF )
>       valid-group         = newsgroups-line
>       newsgroups-line     = newsgroup-name
>                                [ 1*HTAB newsgroup-description ]
>                                [ *WSP moderation-flag ]

However, no reason to specifically disallow it (should the standard be
changed in the future).

> > 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.
>
> The standard says that.  We then won't have to parse descriptive
paragraphs.
>
>
> >> 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.
>
> Yes, the original message was logged before the change.  In log files,
> only *whole* messages are logged and you could then have acted upon it.
>
>
> > 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.
>
> Why wouldn't "foo.bar.*" not remove "foo.bar.defunct"?
> If I only want the subhierarchy "foo.bar.*" (imagine "alt.fr.*" for
French
> people), I will process "foo.bar.*", not "foo.*" (the whole "alt.*").

Because one can't remove nothing from nothing and expect a change.

> > 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?
>
> That the sub-hierarchy is defunct.  You would otherwise never know
> (see my previous example with "alt.fr.*" -- yeah I know that there aren't
> any checkgroups for alt.* but that's just an example and I can do the
> same for instance with "news.admin.*" only).

The fact that the default action is applied (e.g. action "drop") means that
something is still done.

> > There are no groups
> > that match the pattern, so why shouldn't the line be ineffective?
>
> Lines to remove in the newsgroups file, groups to remove from the active
> file...

Yes, but we currently aren't looking at either of those files to determine
if removals exist.  The current procedure has made an assumption - one that
causes many duplicate actions (logging) to take place when it shouldn't.

> > Is it even possible to send a checkgroups message for an empty
hierarchy?
>
> checkgroups-body    = *( valid-group CRLF )
>
> Then, yes.  It is not "1*( valid-group CRLF )".

OK, then how does the system know which hiearchy is to be emptied if the
control line had only "checkgroups" with no hierarchy name (or pattern)
defined?

> > 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.
>
> Not necessarily.  A checkgroups can be empty.

But an empty message can fail to identify its hierarchy under the current
syntax (absent from the header and obviously absent from the body), and
therefore will do nothing.

Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81272
Author: Russ Allbery
Date: Fri, 05 Jun 2009 14:34
46 lines
3469 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> You're reading into this an order that isn't [currently] stated.  I
> can agree ONLY if there is an explicit ordering stated that indicates
> superset through subset order, but no such order has been stated.

Julien is correct here.  The order of the elements doesn't matter in the
current text.

We'll look at trying to make a last minute clarification.  I think the
best clarification may be to require the hierarchy come first, since
otherwise it's kind of confusing (as you've noticed).

> Are you certain that the default set is "everything" as opposed to
> nothing?

No, that's not why or how it works.  There are completely separate
syntactic elements here: a hierarchy to which the checkgroups applies,
and exclusions from within that hierarchy.  They can be listed in
whatever order.  They are not patterns, they do not stack, and order is
not significant.  The hierarchy is required.

This is completely unrelated to wildmat expressions.

>> Such a text is NOT allowed.  There is no descriptive paragraph at the
>> top (or bottom) of a checkgroups.

>>       checkgroups-body    = *( valid-group CRLF )
>>       valid-group         = newsgroups-line
>>       newsgroups-line     = newsgroup-name
>>                                [ 1*HTAB newsgroup-description ]
>>                                [ *WSP moderation-flag ]

> However, no reason to specifically disallow it (should the standard be
> changed in the future).

I'm quite certain that this will never be allowed.  The intention is
that the checkgroups are a complete MIME type in and of themselves.  If
you want to send additional free-form text, use multipart/mixed and a
separate text/plain part.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81274
Author: Julien ÉLIE
Date: Fri, 05 Jun 2009 17:03
30 lines
2869 bytes
Hi Russ,

>>> Such a text is NOT allowed.  There is no descriptive paragraph at the
>>> top (or bottom) of a checkgroups.
>>
>> However, no reason to specifically disallow it (should the standard be
>> changed in the future).
>
> I'm quite certain that this will never be allowed.  The intention is
> that the checkgroups are a complete MIME type in and of themselves.  If
> you want to send additional free-form text, use multipart/mixed and a
> separate text/plain part.

If multipart/mixed is sent, it will break all existing implementations.
It is currently *not* allowed by USEPRO:

    The checkgroups control message contains a list of all the valid groups
    in a hierarchy with descriptions and moderation status.
    [...]
    The body of the message is an entity of type application/news-checkgroups.

The body of a checkgroups does not contain an entity of type
application/news-checkgroups; it is such an entity.

-- 
Julien ÉLIE

« Travailler dur n'a jamais tué personne,
  mais pourquoi prendre le risque ? » (Edgar Bergen) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81275
Author: Russ Allbery
Date: Fri, 05 Jun 2009 17:40
24 lines
2501 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> If multipart/mixed is sent, it will break all existing implementations.
> It is currently *not* allowed by USEPRO:
>
>    The checkgroups control message contains a list of all the valid groups
>    in a hierarchy with descriptions and moderation status.
>    [...]
>    The body of the message is an entity of type application/news-checkgroups.
>
> The body of a checkgroups does not contain an entity of type
> application/news-checkgroups; it is such an entity.

Ah, yes, sorry, I was confusing it with newgroup and
application/news-groupinfo.

Yeah, with checkgroups, the control message just isn't intended to be
processed by people.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81291
Author: D. Stussy
Date: Sat, 06 Jun 2009 00:08
48 lines
3723 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:87ws7q21i1.fsf@windlord.stanford.edu...
> "D. Stussy" <spam@bde-arc.ampr.org> writes:
> > You're reading into this an order that isn't [currently] stated.  I
> > can agree ONLY if there is an explicit ordering stated that indicates
> > superset through subset order, but no such order has been stated.
>
> Julien is correct here.  The order of the elements doesn't matter in the
> current text.
>
> We'll look at trying to make a last minute clarification.  I think the
> best clarification may be to require the hierarchy come first, since
> otherwise it's kind of confusing (as you've noticed).
>
> > Are you certain that the default set is "everything" as opposed to
> > nothing?
>
> No, that's not why or how it works.  There are completely separate
> syntactic elements here: a hierarchy to which the checkgroups applies,
> and exclusions from within that hierarchy.  They can be listed in
> whatever order.  They are not patterns, they do not stack, and order is
> not significant.  The hierarchy is required.
>
> This is completely unrelated to wildmat expressions.

However, when one expression describes a subset of another expression in an
opposite manner (inclusion vs. exclusion), an order of processing is
necessary to resolve the conflicting directives.

Given:  a,  a.b,  a.b.c, a.b.c.d

In the order "a !a.b a.b.c !a.b.c.d", natural left-to-right processing is
the same as superset-subset order, so what results is that we include "all
of a not in a.b except all of a.b.c not in a.b.c.d".

However, let's make the order:  "!a.b.c.d a.b.c !a.b a".  Processing
superset-subset order will result as above, but left-to right will result
as "include all of a" and the other three expressions are rendered
meaningless.  The syntax may not care.  The semantics of order processing
DOES care.

Exclusion lacks the commutative property; order matters.  If the elements
may appear in any syntactic order, the order of application of their use
must be defined, else different answers can ensue.  We should not have
ambiguous results.


Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81294
Author: Russ Allbery
Date: Sat, 06 Jun 2009 00:41
18 lines
2376 bytes
"D. Stussy" <spam@bde-arc.ampr.org> writes:

> However, when one expression describes a subset of another expression
> in an opposite manner (inclusion vs. exclusion), an order of
> processing is necessary to resolve the conflicting directives.

The order of processing applied here is that the hierarchy listed is
included, and then all exclusions are processed, regardless of the order
they're mentioned on the checkgroups control message header.  I think
that's fairly obvious from the document.  However, the ability to
specify exclusions before the hierarchy wasn't intentional and should
probably be removed.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81298
Author: Julien ÉLIE
Date: Sat, 06 Jun 2009 09:24
37 lines
3221 bytes
Hi D. Stussy,

> In the order "a !a.b a.b.c !a.b.c.d", natural left-to-right processing is
> the same as superset-subset order, so what results is that we include "all
> of a not in a.b except all of a.b.c not in a.b.c.d".

I would take newsgroups beginning with "a." or "a.b.c." and remove those
beginning with "a.b." or "a.b.c.d.".
It would in fact be "a. excluding a.b.".


> However, let's make the order:  "!a.b.c.d a.b.c !a.b a".  Processing
> superset-subset order will result as above, but left-to right will result
> as "include all of a" and the other three expressions are rendered
> meaningless.  The syntax may not care.  The semantics of order processing
> DOES care.

I would take newsgroups beginning with "a.b.c." or "a." and remove those
beginning with "a.b.c.d." or "a.b.".
It is exactly the same result as before:  "a. excluding a.b.".

Or is there something I misunderstood on how it should be parsed according
to USEPRO?  Please tell me if it is the case.


> Exclusion lacks the commutative property; order matters.

You do not do the right parsing!
The "OR" operation is commutative.  You do it on additions, and another time
on removals.  You then have *one* addition and *one* removal.  The order you
do this last computation does not matter.

-- 
Julien ÉLIE

« Quand je raconterai mon odyssée, personne ne me croira ! » (Astérix) 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81534
Author: Julien ÉLIE
Date: Sat, 04 Jul 2009 16:15
42 lines
3145 bytes
Hi D. Stussy,

> I understood your wish for the "log" action in checkgroups and
> I will try to address it.

I think this patch should fix the issue you reported.

Index: control/modules/checkgroups.pl
===================================================================
--- control/modules/checkgroups.pl      (révision 8531)
+++ control/modules/checkgroups.pl      (copie de travail)
@@ -36,7 +36,9 @@
         my ($ngname, $ngdesc) = split(/\s+/, $_, 2);
         my $charset_newsgroup = $charset_message;

-        next if ($ngname =~ /$exclusionpats/ or $ngname =~ /$droppats/);
+        next if ($ngname !~ /$newsgrouppats/);
+        next if ($exclusionpats and $ngname =~ /$exclusionpats/);
+        next if ($droppats and $ngname =~ /$droppats/);

         # Find the right charset if absent or forced by control.ctl.
         foreach (@$charset_from) {
@@ -62,7 +64,10 @@
         push(@newbody, $ngname."\t".$ngdesc);
     }

-    if ($action eq 'mail' and $#newbody >= 0) {
+    # We do not go on if there is no changes to do.
+    return if ($#newbody < 0);
+
+    if ($action eq 'mail') {
         my $mail = sendmail("checkgroups by $sender");
         print $mail "$sender posted the following checkgroups message:\n\n";
         print $mail map { s/^~/~~/; "$_\n" } @headers;


-- 
Julien ÉLIE

« Some joys are better expressed in silence as a smile holds more meaning
  than words. » 
Re: Another INN 2.5.0 rc2 bug - control.ctl processing
#81549
Author: D. Stussy
Date: Sun, 05 Jul 2009 01:31
43 lines
3104 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:h2nv6v$ue4$1@news.trigofacile.com...
> Hi D. Stussy,
>
> > I understood your wish for the "log" action in checkgroups and
> > I will try to address it.
>
> I think this patch should fix the issue you reported.
>
> Index: control/modules/checkgroups.pl
> ===================================================================
> --- control/modules/checkgroups.pl      (révision 8531)
> +++ control/modules/checkgroups.pl      (copie de travail)
> @@ -36,7 +36,9 @@
>          my ($ngname, $ngdesc) = split(/\s+/, $_, 2);
>          my $charset_newsgroup = $charset_message;
>
> -        next if ($ngname =~ /$exclusionpats/ or $ngname =~ /$droppats/);
> +        next if ($ngname !~ /$newsgrouppats/);
> +        next if ($exclusionpats and $ngname =~ /$exclusionpats/);
> +        next if ($droppats and $ngname =~ /$droppats/);
>
>          # Find the right charset if absent or forced by control.ctl.
>          foreach (@$charset_from) {
> @@ -62,7 +64,10 @@
>          push(@newbody, $ngname."\t".$ngdesc);
>      }
>
> -    if ($action eq 'mail' and $#newbody >= 0) {
> +    # We do not go on if there is no changes to do.
> +    return if ($#newbody < 0);
> +
> +    if ($action eq 'mail') {
>          my $mail = sendmail("checkgroups by $sender");
>          print $mail "$sender posted the following checkgroups
message:\n\n";
>          print $mail map { s/^~/~~/; "$_\n" } @headers;
>

If I don't comment on this during next weekend, ping me.  I'm going to be
gone for a week, and I'm already packing for my trip.

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