[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] leafnode 2.0b8_ma8rc5 available



Leopold Toetsch <lt@xxxxxxxxxx> writes:

> But - there is always a but in my posts ;-):
> 
> due to my laziness not reading all the docu twice I had an illegal
> filter entry like this:
> 
> newsgroups = *
> maxlines = 1000
> minlines = 2
> maxcrosspost = 5
> action = kill
> 
> When fetchnews comes to this article:
> 
> <68660  Re: swsusp for 2.5.1    Pavel Machek <pavel@xxxxxxx>    Thu, 20
> Dec 2001 21:41:47 GMT   <fa.c2djfiv.vkc1ol@xxxxxxxxxx>
> <fa.c1tnfav.u481gm@xxxxxxxxxx> 81015    2297    Xref: nextra.at
> fa.linux.kernel:68660
> killfilter: trying filter for *
> maxlines filter: lines is 2297, limit 1000, returned 0
> 
> it just hangs at this line.

Does this patch make fetchnews abort with "internal error" instead? If
so, I have the complete fix in rc6, I just want to make sure I fix this
in-depth, so you're getting the "deep" part first. :-)

Index: filterutil.c
===================================================================
RCS file: /home/emma/mycvsroot/leafnode/filterutil.c,v
retrieving revision 1.13
diff -u -u -r1.13 filterutil.c
--- filterutil.c	2001/12/20 04:38:33	1.13
+++ filterutil.c	2001/12/23 11:37:06
@@ -460,7 +471,15 @@
 		   "maxcrosspost filter: newsgroups %ld, limit %ld,"
 		   "returned %d", l, g->limit, match);
 	}
+
 	if (match == 0) {
+	    if (!g->action) {
+		ln_log(LNLOG_SCRIT, LNLOG_CALL,
+		       "killfilter: no action for filter match "
+		       "-- internal error at " __FILE__ ":%u", __LINE__);
+		/* this should have been caught by readfilter */
+		abort();
+	    }
 	    /* article matched pattern/limit: what now? */
 	    if (strcasecmp(g->action, "select") == 0) {
 		return FALSE;

> IMHO the best solution when interpreting the filter file would be, to
> warn about rules without action and insert a "kill" into the rule.

The first half is ok, the second is not. For rc6, it will ignore filter
rules without action and abort when it cannot read the filters.

You cannot know if the user wants the article to be killed or maybe its
score increased or decrased.

-- 
Matthias Andree

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."         Benjamin Franklin

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list