From cc2f2b1c34eeb55da06e274ba8b34823b945e7a7 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Mon, 20 May 2002 12:07:10 +0000 Subject: [PATCH] Some small fixes --- lib/attach.c | 2 +- mbfido/pack.c | 6 ++++-- mbfido/scan.c | 12 +++++++++--- mbsetup/m_marea.c | 11 +++++++++++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/attach.c b/lib/attach.c index ef974885..0a1e71f5 100644 --- a/lib/attach.c +++ b/lib/attach.c @@ -57,7 +57,7 @@ int attach(faddr noden, char *ofile, int mode, char flavor) /* * Attach file to .flo * - * Not that mbcico when connected to a node opens the file "r+", + * Note that mbcico when connected to a node opens the file "r+", * locks it with fcntl(F_SETLK), F_RDLCK, whence=0, start=0L, len=0L. * It seems that this lock is released after the files in the .flo * files are send. I don't know what will happen if we add entries diff --git a/mbfido/pack.c b/mbfido/pack.c index e1d83a3f..f9197732 100644 --- a/mbfido/pack.c +++ b/mbfido/pack.c @@ -121,13 +121,15 @@ int pack_queue(char *name) flavor = 'h'; } else { WriteError("Archiver ZIP not found"); + if (noden.domain) + free(noden.domain); return FALSE; } /* * Generate ARCmail filename and .PKT filename, */ - arcfile = calloc(128, sizeof(char)); + arcfile = calloc(PATH_MAX, sizeof(char)); sprintf(arcfile, "%s", arcname(&noden, nodes.Aka[0].zone, nodes.ARCmailCompat)); pktfile = calloc(40, sizeof(char)); sprintf(pktfile, "%08lx.pkt", sequencer()); @@ -390,7 +392,7 @@ void packmail() colour(3, 0); } - temp = calloc(129, sizeof(char)); + temp = calloc(PATH_MAX, sizeof(char)); sprintf(temp, "%s/tmp", getenv("MBSE_ROOT")); if (chdir(temp) == -1) { diff --git a/mbfido/scan.c b/mbfido/scan.c index 30f77fa8..e93bb44e 100644 --- a/mbfido/scan.c +++ b/mbfido/scan.c @@ -87,7 +87,7 @@ void ScanMail(int DoAll) DoFull = TRUE; } else { scanned = 0; - Fname = calloc(128, sizeof(char)); + Fname = calloc(PATH_MAX, sizeof(char)); temp = calloc(128, sizeof(char)); sprintf(Fname, "%s/tmp/echomail.jam", getenv("MBSE_ROOT")); @@ -139,7 +139,7 @@ void ScanMail(int DoAll) void ScanFull() { - char sAreas[81], sbe[128]; + char *sAreas, sbe[128]; FILE *pAreas; long arearec = 0, sysstart, nextstart; unsigned long Total, Number; @@ -157,6 +157,7 @@ void ScanFull() fflush(stdout); } + sAreas = calloc(PATH_MAX, sizeof(char)); sprintf(sAreas, "%s/etc/users.data", getenv("MBSE_ROOT")); if ((pAreas = fopen(sAreas, "r")) != NULL) { fread(&usrconfighdr, sizeof(usrconfighdr), 1, pAreas); @@ -214,8 +215,10 @@ void ScanFull() sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT")); if ((pAreas = fopen(sAreas, "r")) == NULL) { WriteError("Can't open %s", sAreas); + free(sAreas); return; } + free(sAreas); fread(&msgshdr, sizeof(msgshdr), 1, pAreas); while (fread(&msgs, msgshdr.recsize, 1, pAreas) == 1) { @@ -331,7 +334,7 @@ void ScanFull() void ScanOne(char *path, unsigned long MsgNum) { - char sAreas[81], sbe[128]; + char *sAreas, sbe[128]; FILE *pAreas; long sysstart; unsigned long Total, Area = 0; @@ -368,11 +371,14 @@ void ScanOne(char *path, unsigned long MsgNum) return; } + sAreas = calloc(PATH_MAX, sizeof(char)); sprintf(sAreas, "%s/etc/mareas.data", getenv("MBSE_ROOT")); if ((pAreas = fopen(sAreas, "r")) == NULL) { WriteError("Can't open %s", sAreas); + free(sAreas); return; } + free(sAreas); fread(&msgshdr, sizeof(msgshdr), 1, pAreas); /* diff --git a/mbsetup/m_marea.c b/mbsetup/m_marea.c index c3e42cc6..0c525266 100644 --- a/mbsetup/m_marea.c +++ b/mbsetup/m_marea.c @@ -1091,6 +1091,17 @@ int EditMsgRec(int Area) if (strlen(msgs.Group)) { msgs.Aka = mgroup.UseAka; msgs.Active = TRUE; + msgs.DaysOld = CFG.defdays; + msgs.MaxMsgs = CFG.defmsgs; + msgs.UsrDelete = mgroup.UsrDelete; + msgs.RDSec = mgroup.RDSec; + msgs.WRSec = mgroup.WRSec; + msgs.SYSec = mgroup.SYSec; + msgs.Aliases = mgroup.Aliases; + msgs.NetReply = mgroup.NetReply; + msgs.Quotes = mgroup.Quotes; + msgs.MaxArticles = CFG.maxarticles; + /* * If there is an uplink defined in the group, * and the first connected system is empty,