🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
67 messages
67 total messages Page 2 of 2 Started by John F. Morse Tue, 14 Dec 2010 17:19
Page 2 of 2 • 67 total messages
Re: docheckgroups et al
#83793
Author: Julien ÉLIE
Date: Wed, 05 Jan 2011 20:47
42 lines
2884 bytes
Hi John,

> ctlinnd changegroup control y
>
> This likely would work if the changegroup commands were not created, or
> if that change is not important since these groups are already hidden in
> readers.conf. They are all "y" in the ISC list, but on all of my servers
> they are all "n" for some reason:

You could use "actsync -i actsync.ign" with:

i control
i control.*
i junk

in your actsync.ign file.  It would hide these changegroup commands.



> news@optima11:/var/lib/news$ cat active | grep n$
> control 0000000214 0000000161 n
> control.cancel 0000347431 0000343432 n
> control.checkgroups 0000000178 0000000168 n
> control.newgroup 0000000092 0000000092 n
> control.rmgroup 0000000307 0000000307 n
> junk 0000000006 0000000007 n
>
> Were they "n" in the INN2 package from Debian, and in the source I
> compiled for one server?

Yes.  "n" is the default flag in the active file shipped with INN.
Not very important, though.  It also works with "y".


Maybe they could be changed to "n" on ftp.isc.org?  (I do not remember 
whether the question was already asked or answered.)

-- 
Julien ÉLIE

« Dès que le silence se fait, les gens le meublent. »
   (Raymond Devos)
Re: docheckgroups et al
#83794
Author: Russ Allbery
Date: Wed, 05 Jan 2011 20:53
26 lines
2488 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

>> news@optima11:/var/lib/news$ cat active | grep n$
>> control 0000000214 0000000161 n
>> control.cancel 0000347431 0000343432 n
>> control.checkgroups 0000000178 0000000168 n
>> control.newgroup 0000000092 0000000092 n
>> control.rmgroup 0000000307 0000000307 n
>> junk 0000000006 0000000007 n
>>
>> Were they "n" in the INN2 package from Debian, and in the source I
>> compiled for one server?

> Yes.  "n" is the default flag in the active file shipped with INN.
> Not very important, though.  It also works with "y".

> Maybe they could be changed to "n" on ftp.isc.org?  (I do not remember
> whether the question was already asked or answered.)

I don't see any obvious reason not to, so done.

-- 
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: docheckgroups et al
#83795
Author: Julien ÉLIE
Date: Wed, 05 Jan 2011 21:17
22 lines
2416 bytes
>>> control.cancel 0000347431 0000343432 n
>>>
>>> Were they "n" in the INN2 package from Debian, and in the source I
>>> compiled for one server?
>>
>> Yes.  "n" is the default flag in the active file shipped with INN.
>> Not very important, though.  It also works with "y".
>>
>> Maybe they could be changed to "n" on ftp.isc.org?  (I do not remember
>> whether the question was already asked or answered.)
>
> I don't see any obvious reason not to, so done.

Thanks, Russ.

-- 
Julien ÉLIE

« N'as-tu jamais fait ces rêves, Neo, qui ont l'air plus vrais que la
   réalité ? Si tu étais incapable de sortir de l'un de ces rêves,
   comment ferais-tu la différence entre le monde du rêve et le monde
   réel ? » (Morpheus, _Matrix_)
Re: docheckgroups et al
#83797
Author: D. Stussy
Date: Wed, 05 Jan 2011 21:59
41 lines
3293 bytes
"Russ Allbery" <rra@stanford.edu> wrote in message
news:877hejyswe.fsf@windlord.stanford.edu...
> Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
> >> news@optima11:/var/lib/news$ cat active | grep n$
> >> control 0000000214 0000000161 n
> >> control.cancel 0000347431 0000343432 n
> >> control.checkgroups 0000000178 0000000168 n
> >> control.newgroup 0000000092 0000000092 n
> >> control.rmgroup 0000000307 0000000307 n
> >> junk 0000000006 0000000007 n
> >>
> >> Were they "n" in the INN2 package from Debian, and in the source I
> >> compiled for one server?
>
> > Yes.  "n" is the default flag in the active file shipped with INN.
> > Not very important, though.  It also works with "y".
>
> > Maybe they could be changed to "n" on ftp.isc.org?  (I do not remember
> > whether the question was already asked or answered.)
>
> I don't see any obvious reason not to, so done.

I do.  As "n", the pseudogroups will accept articles addressed specifically
to themselves, while marked as "x", they will not while still accepting
articles that fit their specific purposes.  On my INN server, I have them
marked as "x" and they work just fine:

junk 0000745129 0000000001 x
control 0000000025 0000000012 x
control.cancel 0001989073 0001984088 x
control.checkgroups 0000000568 0000000128 x
control.newgroup 0000000614 0000000261 x
control.rmgroup 0000001533 0000000330 x
control.cmsg 0000024498 0000024477 x

The last group is the catch-all for those servers in Asia sending the
defective cancel messages (which I wish to keep out of "control").

Therefore, I think that ISC should show them marked with "x", not "n".

Re: docheckgroups et al
#83800
Author: Julien ÉLIE
Date: Wed, 05 Jan 2011 22:24
59 lines
3376 bytes
Hi John,

> The issue is docheckgroups.

OK, thanks to your help (access to your news server), I see that you do 
not have gawk installed and therefore that mawk is used instead.

The behaviour seems to be different between these two programs.


Currently, we have lines written this way in docheckgroups:

${AWK} '{ if (($1 ~ /'"${1:-.}"'/) && ($1 ~ /'"${PATS}"'/)) \
{ print $1 } }' \
${T}/$$msg | ${SORT} >${T}/$$newsgrps


The problem comes from the quoted variables inside the patterns.  I 
manage to make them work with both mawk and gawk if I use this syntax:

${AWK} '{ if (($1 ~ progargument) && ($1 ~ filepattern)) \
{ print $1 } }' "progargument=${1:-.}" "filepattern=${PATS}" \
${T}/$$msg | ${SORT} >${T}/$$newsgrps


I must admit that I do not know why docheckgroups with mawk outputs 
something with a small newsgroups file, and nothing with a big one. 
(Pattern matchings should not change depending on the length of the 
newsgroups file…)





Are there awk connoisseurs here who could tell if this is the right fix 
to do throughout docheckgroups?

(It is the only affected file in INN.)

Thanks beforehand!




>> plus my local groups which are listed in /etc/news/localgroups.
>
> Ah, so it is based on hierarchies? Then why did it want to remove my
> local groups?

Because of the same problem; mawk does not do the expected job like gawk 
to extract your local newsgroups.

-- 
Julien ÉLIE

« N'as-tu jamais fait ces rêves, Neo, qui ont l'air plus vrais que la
   réalité ? Si tu étais incapable de sortir de l'un de ces rêves,
   comment ferais-tu la différence entre le monde du rêve et le monde
   réel ? » (Morpheus, _Matrix_)
Re: docheckgroups et al
#83801
Author: Julien ÉLIE
Date: Wed, 05 Jan 2011 22:47
18 lines
2315 bytes
> I must admit that I do not know why docheckgroups with mawk outputs
> something with a small newsgroups file, and nothing with a big one.
> (Pattern matchings should not change depending on the length of the
> newsgroups file…)

Oh, interestingly, there are mawk segfaults in /var/log/messages:

Jan  5 23:03:07 news kernel: mawk[28435]: segfault at 202e5b7b ip 
b771ceca sp bfe442ec error 4 in libc-2.3.6.so[b76b2000+127000]

So did we run into a mawk bug?!?

-- 
Julien ÉLIE

« Le Périssable et le Temporel ne sont que fictions et symboles ;
   l'insuffisant est arrivé jusqu'ici ; l'inénarrable est accompli ;
   l'Éternel féminin nous attire vers le Ciel. » (Goethe)
Re: docheckgroups et al
#83802
Author: Julien ÉLIE
Date: Wed, 05 Jan 2011 23:18
36 lines
2852 bytes
Hi Dieter,

> control.cmsg 0000024498 0000024477 x
> 
> The last group is the catch-all for those servers in Asia sending
> the defective cancel messages (which I wish to keep out of
> "control").

Thanks for pointing out this issue.

We're speaking about control articles badly formatted.  For instance:

Newsgroups: nctu.talk
Subject: cmsg cancel <NCTU$A16I6I8M@bbs.cs.nctu.edu.tw>
Control: cmsg cancel <NCTU$A16I6I8M@bbs.cs.nctu.edu.tw.mirrorpost.nctu.talk>
Message-ID: <CNCTU$A16I6I8M@bbs.cs.nctu.edu.tw.mirrorpost.nctu.talk>



I believe such invalid control articles MUST NOT (per RFC 5537)
have been injected into Usenet.
nnrpd rejects these control articles if a user tries to post one.


Wouldn't it be a useful check to do inside Cleanfeed?  Rejecting
badly formatted control articles.
Cleanfeed can already reject "ihave", "sendsys" and a few other
obsolete control articles.  It would be best if it could reject
everything that is not a standard control article.

-- 
Julien ÉLIE

« Le Périssable et le Temporel ne sont que fictions et symboles ;
  l'insuffisant est arrivé jusqu'ici ; l'inénarrable est accompli ;
  l'Éternel féminin nous attire vers le Ciel. » (Goethe)
Re: docheckgroups et al
#83803
Author: Russ Allbery
Date: Wed, 05 Jan 2011 23:21
36 lines
3288 bytes
"D. Stussy" <spam+newsgroups@bde-arc.ampr.org> writes:

> I do.  As "n", the pseudogroups will accept articles addressed
> specifically to themselves, while marked as "x", they will not while
> still accepting articles that fit their specific purposes.  On my INN
> server, I have them marked as "x" and they work just fine:

> junk 0000745129 0000000001 x
> control 0000000025 0000000012 x
> control.cancel 0001989073 0001984088 x
> control.checkgroups 0000000568 0000000128 x
> control.newgroup 0000000614 0000000261 x
> control.rmgroup 0000001533 0000000330 x
> control.cmsg 0000024498 0000024477 x

> The last group is the catch-all for those servers in Asia sending the
> defective cancel messages (which I wish to keep out of "control").

> Therefore, I think that ISC should show them marked with "x", not "n".

Well, bear in mind that they were originally y.  Moving from y to n is at
least a step towards what you want.

"n" rejects local posts.  "x" rejects local and remote posts.  I'm more
willing to express a default policy about what should be sent than about
what should be received.  Those groups do periodically get direct
postings, and while filtering out all such postings is a legitimate
decision to make, it's one that I'm a bit more reluctant to make by
default.  This is the same reason why the defaults in INN are "n".  junk
in particular used to get a fair bit of sporadic traffic.

-- 
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: docheckgroups et al
#83804
Author: Russ Allbery
Date: Wed, 05 Jan 2011 23:23
24 lines
2548 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> I must admit that I do not know why docheckgroups with mawk outputs
> something with a small newsgroups file, and nothing with a big
> one. (Pattern matchings should not change depending on the length of the
> newsgroups file…)

The mawk Debian package description includes:

 Mawk is smaller and much faster than gawk. It has some compile-time
 limits such as NF = 32767 and sprintf buffer = 1020.

I suspect one of those limits or some other compile-time limit has
something to do with it.

I unfortunately don't know enough awk to tell you whether that change
would work.  At the point where I have to start writing awk like that, I
usually switch to Perl.  :)

-- 
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: docheckgroups et al
#83805
Author: John F. Morse
Date: Thu, 06 Jan 2011 00:13
39 lines
3168 bytes
Hi Russ,

> Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:
>   
>> I must admit that I do not know why docheckgroups with mawk outputs
>> something with a small newsgroups file, and nothing with a big
>> one. (Pattern matchings should not change depending on the length of the
>> newsgroups file…)
>>     
>
> The mawk Debian package description includes:
>
>  Mawk is smaller and much faster than gawk. It has some compile-time
>  limits such as NF = 32767 and sprintf buffer = 1020.
>
> I suspect one of those limits or some other compile-time limit has
> something to do with it.

It is good to verify that I'm not as crazy as I though I was yesterday. ;-)

I found these /var/log/messages concerning kernel segfaults with mawk 
yesterday, around the time I was working with docheckgroups.

After my docheckgroups testing, the logging ended so I didn't pursue 
them right away.

Then again today, while Julien was doing the same tests, I noticed them 
again.

They don't happen when the newsgroups file is small. That explains why I 
had docheckgroups failures "intermittently" a couple of weeks ago when 
attempting to pipe the output into mod-active. I was using several 
smaller portions of the complete newsgroups file.


-- 
John

When a person has -- whether they knew it or not -- already rejected the Truth, by what means do they discern a lie?
Re: docheckgroups et al
#83806
Author: Russ Allbery
Date: Thu, 06 Jan 2011 00:35
15 lines
2294 bytes
"John F. Morse" <john@example.invalid> writes:

> They don't happen when the newsgroups file is small. That explains why I
> had docheckgroups failures "intermittently" a couple of weeks ago when
> attempting to pipe the output into mod-active. I was using several
> smaller portions of the complete newsgroups file.

Yeah, that would explain a lot of things.  mawk was probably failing in
such a way that the rest of docheckgroups thought there were no changes.

-- 
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: docheckgroups et al
#83809
Author: John F. Morse
Date: Thu, 06 Jan 2011 01:39
28 lines
2289 bytes
Hi Julien,

> OK, thanks to your help (access to your news server), I see that you 
> do not have gawk installed and therefore that mawk is used instead.


You are welcome, and thanks for finding some problems.


> The behaviour seems to be different between these two programs.


FYI there seems to be several implementations of awk:

http://en.wikipedia.org/wiki/Gawk_%28GNU_package%29#Versions_and_implementations


> Because of the same problem; mawk does not do the expected job like 
> gawk to extract your local newsgroups.


OK. Good to know that.


-- 
John

When a person has -- whether they knew it or not -- already rejected the Truth, by what means do they discern a lie?
Re: docheckgroups et al
#83810
Author: Julien ÉLIE
Date: Thu, 06 Jan 2011 22:39
88 lines
3863 bytes
Hi Russ,

> The mawk Debian package description includes:
> 
>   Mawk is smaller and much faster than gawk. It has some compile-time
>   limits such as NF = 32767 and sprintf buffer = 1020.
> 
> I suspect one of those limits or some other compile-time limit has
> something to do with it.

Oh, yes, it must be that.  Thanks for having found that limitation.



> I unfortunately don't know enough awk to tell you whether that change
> would work.  At the point where I have to start writing awk like that, I
> usually switch to Perl.  :)

:-)


I have just made a new version (still not committed) which seems to
work fine.

Example of changes:


BEFORE:

cat | ${AWK} '{ if ($1 !~ /'"${2:-^#}"'/ && $1) { print $0 } }' >${T}/$$msg


NOW:

cat | ${PERL} -e 'while (<STDIN>) { my @fields = split();
    print $_ if ((scalar(@fields) > 0) && ($fields[0] !~ /'${2:-^#}'/)
    && ($fields[0] !~ /^#/)); }' > ${T}/$$msg





BEFORE:

${AWK} '{ if (($1 ~ /'"${1:-.}"'/) && ($1 ~ /'"${PATS}"'/) && ($0 ~ / m$/)) { print $1 } }' ${ACTIVE} | ${SORT} >${T}/$$amod.all


NOW:

cat ${ACTIVE} | ${PERL} -e 'while (<STDIN>) { my @fields = split();
    print $fields[0]."\n" if ((scalar(@fields) > 0) && ($fields[0] =~ /'${1:-.}'/)
    && ($fields[0] =~ /'${PATS}'/) && ($_ =~ / m$/)); }' | ${SORT} > ${T}/$$amod.all





BEFORE:

${AWK} -F'\t' '{if (length($1) < 8) {print $1"\t\t\t"$2} \
    else {if (length($1) < 16) {print $1"\t\t"$2} \
    else {print $1"\t"$2}}}' >${NEWSGROUPS}


NOW:

${PERL} -e 'while (<STDIN>) { my @fields = split("\t", $_, 2);
    next if (scalar(@fields) == 0);
    my $length = length("$fields[0]");
    my $desc;
    if (scalar(@fields) == 2) { $desc = "$fields[1]"; } else { $desc = ""; }
    if ($length < 8) { print $fields[0]."\t\t\t".$desc; }
    elsif ($length < 16) { print $fields[0]."\t\t".$desc; }
    else { print $fields[0]."\t".$desc; } }' > ${NEWSGROUPS}




In case you see something suspicious, do not hesitate to tell.

(Maybe I could have used "perl -ne" to avoid the while() loop, or even
"perl -ane" to avoid the split(), but it looked clearer this way to
debug and better see what is going on in the script.)

-- 
Julien ÉLIE

« Medicina animi. »
Re: docheckgroups et al
#83811
Author: Russ Allbery
Date: Fri, 07 Jan 2011 02:25
30 lines
2528 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> writes:

> I have just made a new version (still not committed) which seems to
> work fine.

> Example of changes:


> BEFORE:

> cat | ${AWK} '{ if ($1 !~ /'"${2:-^#}"'/ && $1) { print $0 } }' >${T}/$$msg


> NOW:

> cat | ${PERL} -e 'while (<STDIN>) { my @fields = split();
>     print $_ if ((scalar(@fields) > 0) && ($fields[0] !~ /'${2:-^#}'/)
>     && ($fields[0] !~ /^#/)); }' > ${T}/$$msg

Hm, the mix of shell and Perl still makes this kind of hard to follow and
read.  Have you considered rewriting the whole script in Perl?

(You do need the "" around the $2 parameter, in case it contains shell
metacharacters.  There are a few other places like that as well.)

-- 
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: docheckgroups et al
#83812
Author: Julien ÉLIE
Date: Sun, 09 Jan 2011 20:38
40 lines
2774 bytes
Hi Russ,

> Hm, the mix of shell and Perl still makes this kind of hard to
> follow and read.

Yes, you're totally right.  This script becomes less and less
maintainable, patch after patch.


> (You do need the "" around the $2 parameter, in case it contains
> shell metacharacters.  There are a few other places like that as
> well.)

OK, thanks!


> Have you considered rewriting the whole script in Perl?

I agree it would be the best thing to do.
Well, I will have a look at it.

http://inn.eyrie.org/trac/ticket/57

Urs JanĂźen has an updated version of docheckgroups written in Perl:
ftp://ftp.tin.org/pub/news/servers/utils/docheckgroups-inn-2.x.pl

This script also handles a complete checkgroups article in entry
(headers+body).
I will start from it.  I have to add the new functionalities of the 
docheckgroups shipped with INN 2.4 and INN 2.5.

Urs, in case you read us, do not hesitate to tell if this version on 
ftp.tin.org is not the latest one for the script.

-- 
Julien ÉLIE

« – Par Thor !
   – Par Odin !
   – Par exemple ! » (Astérix)
Re: docheckgroups et al
#83814
Author: Urs JanĂźen
Date: Sun, 09 Jan 2011 23:06
6 lines
2203 bytes
In <8oukm6Ff0tU1@mid.individual.net>, Julien ÉLIE wrote:
> Urs, in case you read us, do not hesitate to tell if this version on 
> ftp.tin.org is not the latest one for the script.

It's the version I use with inn 2.2.3 (don't know if it works with
newer inns); AFAIK there are no newer versions.
Page 2 of 2 • 67 total messages
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