🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #84763

Re: Mistake in newsfeeds caused INN to crash

#84763
From: Julien ÉLIE
Date: Fri, 16 Mar 2012 22:20
86 lines
3792 bytes
Hi Tim,

> I just added a new feed to 'newsfeeds' but I made an error in the
> config. What I accidentally configured was:
> 
> news.example.com:\
>          :localhierarchy*,control*:\
>          :Tm:innfeed!
> 
> Anyway, when I did 'ctlinnd reload newsfeeds' the server crashed.

We can add a check of the syntax of the newsfeeds file when trying
to reload "all", "active" and "newsfeeds".

It would give:

% ctlinnd reload newsfeeds ''
ctlinnd: Found 1 errors -- see syslog
zsh: exit 1     ctlinnd reload newsfeeds ''

% cat /var/log/news/news.err
Mar 16 22:59:24 news innd: news.example.com bad_newsfeeds unknown field 3 flag



The problem is that it fixes the first problem (":" at the end
of the first line will be detected) but if you only have the second
problem (":" at the end of the second line), it will still not be
detected.

news.example.com\
          :localhierarchy*,control*\
          :Tm:::::::innfeed!

will also trigger problems off...

=> Mar 16 23:09:40 news innd: news.example.com funnel_bad



For this fix, we would need the (long-waited-for) new inn.conf parser
for the newsfeeds file...


Anyway, here is a patch for the first issue:

--- innd/cc.c	(révision 9397)
+++ innd/cc.c	(copie de travail)
@@ -1315,6 +1315,7 @@
 CCreload(char *av[])
 {
     const char *p;
+    const char *error;
 
 #ifdef DO_PERL
     static char BADPERLRELOAD[] = "1 Failed to define filter_art" ;
@@ -1327,6 +1328,9 @@
 
     p = av[0];
     if (*p == '\0' || strcmp(p, "all") == 0) {
+        /* Check the syntax of the newsfeeds file before reloading. */
+        if ((error = CCcheckfile(NULL)) != NULL)
+            return error;
 	SITEflushall(false);
         if (Mode == OMrunning)
 	    InndHisClose();
@@ -1348,7 +1352,10 @@
 	p = "all";
     }
     else if (strcmp(p, "active") == 0 || strcmp(p, "newsfeeds") == 0) {
-	SITEflushall(false);
+        /* Check the syntax of the newsfeeds file before reloading. */
+        if ((error = CCcheckfile(NULL)) != NULL)
+            return error;
+        SITEflushall(false);
 	ICDwrite();
 	ICDsetup(true);
     }



-- 
Julien ÉLIE

« Mais écoutez ce qu'on vous dit, au lieu de taper comme un
  sourd ! » (Astérix)
Technical Details
Message-ID: <jk0ebg$itk$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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!87.79.20.101.MISMATCH!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!.POSTED.aaubervilliers-652-1-97-167.w83-114.abo.wanadoo.fr!not-for-mail
References: <uk7vl7d8l4i0rj7iv2fifhjiurn6kl1ar1@4ax.com>

Show Full Headers
Complete Article Headers
Message-ID: <jk0ebg$itk$1@news.trigofacile.com>
Subject: Re: Mistake in newsfeeds caused INN to crash
Date: Fri, 16 Mar 2012 23:20:32 +0100
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <uk7vl7d8l4i0rj7iv2fifhjiurn6kl1ar1@4ax.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.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!87.79.20.101.MISMATCH!newsreader4.netcologne.de!news.netcologne.de!newsfeed.straub-nv.de!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!.POSTED.aaubervilliers-652-1-97-167.w83-114.abo.wanadoo.fr!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Mime-Version: 1.0
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 16 Mar 2012 22:20:32 +0000 (UTC)
Injection-Info: news.trigofacile.com;
 posting-host="aaubervilliers-652-1-97-167.w83-114.abo.wanadoo.fr:83.114.192.167";
 logging-data="19380"; mail-complaints-to="abuse@trigofacile.com"
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; fr;
In-Reply-To: <uk7vl7d8l4i0rj7iv2fifhjiurn6kl1ar1@4ax.com>
Lines: 85
X-Original-Bytes: 3576