🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81086

Re: filter_nnrpd.pl and errors

#81086
From: Julien ÉLIE
Date: Sun, 24 May 2009 08:53
98 lines
5038 bytes
Hi Paolo,

Hadn't innreport reported the problem near the beginning of one of its daily
reports?  (in the error section)


> I know that when nnrpd tries to execute filter_post() inside filter_nnrpd.pl,
> if there's an error, an message is logged with *error* priority through
> syslog and the article is *accepted* . IMHO this is wrong.
> Since filter_post() in mostly used as an antispam filter, if that filter dies
> or can't be executed due some syntax error in the code, the article should
> be *rejected* instead of being *accepted* . In the currently used way, if
> due some reason the filter can't be executed, the server becomes completely
> open till the newsmaster becomes aware of that error than solves it.

To be consistent, we should have the same behaviour with innd.  filter_art()
is mostly used as an antispam filter and we then have to *reject* all articles
if Cleanfeed dies.
I'm not very appealed by that...



> nnrpd logs filter errors with 'err' syslog priority. IMHO this is bad (and
> maybe wrong). Since filtering is a vital feature, errors should be logged
> with 'crit' priority instead 'err'.

It is easy to change the log from 'err' to 'crit'.

Index: nnrpd/perl.c
===================================================================
--- nnrpd/perl.c      (révision 8490)
+++ nnrpd/perl.c      (copie de travail)
@@ -182,7 +182,7 @@
     buf[0] = '\0';

     if (SvTRUE(ERRSV)) {    /* Check $@. */
-        syslog(L_ERROR, "Perl function filter_post died: %s",
+        syslog(L_FATAL, "Perl function filter_post died: %s",
                SvPV(ERRSV, PL_na));
         (void)POPs;
         PerlFilter(false);

Index: innd/perl.c
===================================================================
--- innd/perl.c      (révision 8490)
+++ innd/perl.c      (copie de travail)
@@ -113,7 +113,7 @@
     /* Check $@, which will be set if the sub died. */
     buf[0] = '\0';
     if (SvTRUE(ERRSV)) {
-        syslog(L_ERROR, "Perl function filter_art died on article %s: %s",
+        syslog(L_FATAL, "Perl function filter_art died on article %s: %s",
                HDR_FOUND(HDR__MESSAGE_ID) ? HDR(HDR__MESSAGE_ID) : "?",
                SvPV(ERRSV, PL_na));
         (void) POPs;
@@ -160,7 +160,7 @@
     /* Check $@, which will be set if the sub died. */
     buf[0] = '\0';
     if (SvTRUE(ERRSV)) {
-        syslog(L_ERROR, "Perl function filter_messageid died on id %s: %s",
+        syslog(L_FATAL, "Perl function filter_messageid died on id %s: %s",
                messageID, SvPV(ERRSV, PL_na));
         (void) POPs;
         PerlFilter(false);
@@ -220,7 +220,7 @@

     /* Check $@, which will be set if the sub died. */
     if (SvTRUE(ERRSV)) {
-        syslog(L_ERROR, "Perl function filter_mode died: %s",
+        syslog(L_FATAL, "Perl function filter_mode died: %s",
                 SvPV(ERRSV, PL_na));
         (void) POPs;
         PerlFilter(false);


The behaviour for Python has to be checked.  I think it does not die but
will give an error each time an article is received (but I have to test
it to be sure).


However, is it really what should be done?

I read in HACKING:

    For historical reasons, error messages that are fatal to the news subsystem
    are logged at the LOG_CRIT priority, and therefore die in innd should use
    message_log_syslog_crit.  This seems like priority inflation and may change
    in the future to message_log_syslog_err.


Besides, when there is an error at startup (filter_nnrpd.pl has not a
correct syntax for instance), it is logged as 'err', not 'crit'.

-- 
Julien ÉLIE

« Ambo florentes aetatibus, Arcades ambo » (Virgile, _Églogue VII_) 
Technical Details
Message-ID: <gvb1ud$v18$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
References: <gv8scl$t24$1@aioe.org>

Show Full Headers
Complete Article Headers
Message-ID: <gvb1ud$v18$1@news.trigofacile.com>
Subject: Re: filter_nnrpd.pl and errors
Date: Sun, 24 May 2009 10:53:22 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <gv8scl$t24$1@aioe.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 98
NNTP-Posting-Host: aaubervilliers-151-1-37-195.w83-112.abo.wanadoo.fr
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
 reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: news.trigofacile.com 1243155214 31784 83.112.148.195 (24 May 2009
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Sun, 24 May 2009 08:53:34 +0000 (UTC)
In-Reply-To: <gv8scl$t24$1@aioe.org>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
X-Original-Bytes: 4849