From 33eb0cc7e20d72f5a55a03f70ea8e50960091ef2 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 15 Mar 2002 21:16:16 +0000 Subject: [PATCH] Possible fixes for nodes database corruption --- mbfido/areamgr.c | 5 +++++ mbfido/createm.c | 3 ++- mbfido/tosspkt.c | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mbfido/areamgr.c b/mbfido/areamgr.c index 0d1af2d6..4e31f521 100644 --- a/mbfido/areamgr.c +++ b/mbfido/areamgr.c @@ -763,6 +763,11 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) Area[i]=toupper(Area[i]); if (!SearchMsgs(Area)) { + /* + * Close noderecord, autocreate will destroy it. + */ + UpdateNode(); + Syslog('m', " Area not found, trying to create"); temp = calloc(PATH_MAX, sizeof(char)); sprintf(temp, "%s/etc/mgroups.data", getenv("MBSE_ROOT")); diff --git a/mbfido/createm.c b/mbfido/createm.c index f8a73c65..e186ce5f 100644 --- a/mbfido/createm.c +++ b/mbfido/createm.c @@ -82,7 +82,8 @@ int create_msgarea(char *marea, faddr *p_from) * 0 - All Seems Well * 1 - Some error * - * The current nodes record may be destroyed after this! + * The current nodes record may be destroyed after this, + * make sure it is saved. */ int CheckEchoGroup(char *Area, int SendUplink, faddr *f) { diff --git a/mbfido/tosspkt.c b/mbfido/tosspkt.c index a3cd2191..52d16a0a 100644 --- a/mbfido/tosspkt.c +++ b/mbfido/tosspkt.c @@ -205,6 +205,7 @@ int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, } if (!SearchMsgs(marea)) { + UpdateNode(); Syslog('m', "Unknown echo area %s", marea); if (!create_msgarea(marea, p_from)) { WriteError("Create echomail area %s failed", marea); @@ -215,6 +216,7 @@ int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, free(buf); return 4; } + SearchNode(Link.aka); if (!SearchMsgs(marea)) { WriteError("Unknown echo area %s", marea); echo_bad++;