From 97a8c60ccdf7eac1c1a271319fe4081ade6946d9 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sun, 18 Mar 2007 13:30:48 +0000 Subject: [PATCH] Fixed Zone bug in nodelist compiler --- ChangeLog | 7 +++++++ mbfido/mbindex.c | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 649267bd..887e6649 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,13 @@ v0.91.7 07-Mar-2007 Content-Transfer-Encoding are temporary stored in the fido message as kludges. + mbindex: + When the first Zone entry is missing in the nodelist, mbindex + aborts with a fatal error and doesn't replace the nodelist + index. + Keep the latest 4 instead of 2 nodelists in the nodelist + directory to allow a few weeks for recovery. + mbnntp: Suppress logging of passwords. diff --git a/mbfido/mbindex.c b/mbfido/mbindex.c index 59df3882..7f039878 100644 --- a/mbfido/mbindex.c +++ b/mbfido/mbindex.c @@ -630,6 +630,17 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n udx.node = ndx.node; udx.point = ndx.point; + if (ndx.zone == 0) { + WriteError("%s(%u): no Zone entry found", nlname,lineno); + fclose(nl); + + if (!do_quiet) { + printf(" %d entries\n", entries); + fflush(stdout); + } + return 1; + } + /* * Now search for the baudrate field, just to check if it's there. */ @@ -827,12 +838,12 @@ int makelist(char *base, unsigned short zo, unsigned short ne, unsigned short no } /* - * Sort found nodelists by age and kill all but the newest 2. + * Sort found nodelists by age and kill all but the newest 4. */ sort_fdlist(&fdl); while (files) { p = pull_fdlist(&fdl); - if (files > 2) { + if (files > 4) { Syslog('+', "Remove old \"%s\"", p); unlink(fullpath(p)); }