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

Re: [leafnode-list] Patch to fix "clamp_maxage = 0".



"Michael O'Quinn" <michael@xxxxxxxxxxx> writes:

> On Mon, 30 Dec 2002, Matthias Andree wrote:
>
>> "Michael O'Quinn" <michael@xxxxxxxxxxx> writes:
>> 
>> > I just installed 1.31, and now I get the following error when fetchnews 
>> > runs...
>> 
>> I have some déjà-réparé, the feeling you fixed a code defect before 
>> 
>
> Well yes, actually, it's what I used to do.  I just decided to get off my 
> lazy butt and actually deliver a patch instead of just a complaint.

Hum, I just had a second look, and configutil.c was right the way it was
before the patch, so I reverted it. Configuring a huge maxage (bigger
than expire) makes not sense, or is there a use for it that I don't see?
maxage=0 switches the age checks off altogether and is more efficient.

You cannot have a maxage beyond 24855 on 32-bit machines either,
leafnode 1.9.32 will enforce this, patch below.

Could you please try this patch with maxage=24855 and with maxage=0, and
report your results for either case:

Index: configutil.c
===================================================================
RCS file: /var/CVS/leafnode-1/configutil.c,v
retrieving revision 1.28
diff -u -r1.28 configutil.c
--- configutil.c	15 Dec 2002 15:55:11 -0000	1.28
+++ configutil.c	30 Dec 2002 03:37:38 -0000
@@ -323,6 +323,10 @@
 		       (strcmp("maxold", param) == 0)) {
 		/* maxold is for compatibility with leafnode+ */
 		maxage = atoi(value);
+		if (maxage * 86400 > LONG_MAX) {
+		    ln_log(LNLOG_SERR, LNLOG_CTOP, "config: maxage must not exceed %ld", LONG_MAX/86400);
+		    exit(1);
+		}
 		if (debugmode)
 		    syslog(LOG_DEBUG, "config: maxage is %d", maxage);
 	    } else if (strcmp("maxfetch", param) == 0) {

-- 
Matthias Andree
leafnode-1 download: http://sourceforge.net/projects/leafnode/
leafnode-1 docs/new: http://mandree.home.pages.de/leafnode/
leafnode-2 homepage: http://mandree.home.pages.de/leafnode/beta/

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