From 3acdbd823953e9f15ab409aeaa0363962c5e06c8 Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 28 Sep 2002 22:22:50 +0000 Subject: [PATCH] Updated logging init --- ChangeLog | 11 +++++++- TODO | 4 --- mbcico/mbcico.c | 2 +- mbcico/mbout.c | 2 +- mbfido/areamgr.c | 66 +++++++++++++++++++++++----------------------- mbfido/createf.c | 4 +-- mbfido/createm.c | 4 +-- mbfido/filemgr.c | 61 +++++++++++++++++++++--------------------- mbfido/mbaff.c | 2 +- mbfido/mbdiff.c | 2 +- mbfido/mbfido.c | 2 +- mbfido/mbfile.c | 2 +- mbfido/mbindex.c | 2 +- mbfido/mbmsg.c | 2 +- mbfido/mbseq.c | 3 +-- mbfido/mgrutil.c | 18 ++++++------- mbsebbs/mball.c | 2 +- mbsebbs/mbnewusr.c | 3 ++- mbsebbs/mbsebbs.c | 3 +-- mbsebbs/mbstat.c | 2 +- mbsebbs/mbuser.c | 2 +- 21 files changed, 102 insertions(+), 97 deletions(-) diff --git a/ChangeLog b/ChangeLog index e9841435..8d64ccc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ $Id$ WARNING: Extra debug logging enabled for checking internet news dupes. This will just make bigger logfiles if you gate news. Since 28-08-2002 mbfido news produces real big logs!! + Extra debug logging will be removed around 14 Oct 2002. MBSEBBS History. @@ -17,13 +18,18 @@ v0.35.03 06-Jul-2002 After installation restart mbtask. Start mbsetup, enter global configuration and exit and save. This will setup the new outbound queue path, default is - /opt/mbse/var/queue. + /opt/mbse/var/queue. This will also set defaults for area- + filemgr logging and security. common.a: Added nodelist override to the nodelist lookup function. Added protection against emty rfc headers with only a space. Added test for HA archiver. + clcomm.a: + Added Mgrlog function, logs default to manager.log. Does also + log to Syslog with level '+'. + mbinet.a: If during a connect a newsserver refuses the connection then don't close our side of the connection. This is a temporary @@ -70,6 +76,8 @@ v0.35.03 06-Jul-2002 made, this must prevent destroying a another lock. Added extra check to unlock directory function to check that only the owned lock is removed. + Area- and FileMgr requests are now also logged in manager.log + Auto created and removed areas are also logged in manager.log newuser: Check for Unix accounts is now case sensitive. @@ -117,6 +125,7 @@ v0.35.03 06-Jul-2002 Added setup setting for outbound queue in global setup. Added support for default setup of the HA archiver. Changed Rubout key to do the same as Backspace. (experimental) + Added setup to the nodes record for security flags. mbmon: Changed Rubout key to do the same as Backspace. (experimental) diff --git a/TODO b/TODO index a0a5ddfe..88b0cbfa 100644 --- a/TODO +++ b/TODO @@ -70,10 +70,6 @@ mbfido: N: Add macro's for stats of all months. - L: A separate log for processed area/filemgr requests. - - N: Add logging info about added/removed areas. - L: Implement netmail K/S flag to mark netmail Deleted. N: Implement file requests for directory nodes. diff --git a/mbcico/mbcico.c b/mbcico/mbcico.c index 5d28e398..d0cebe7e 100644 --- a/mbcico/mbcico.c +++ b/mbcico/mbcico.c @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) TermInit(1); t_start = c_start = c_end = time(NULL); - InitClient(pw->pw_name, (char *)"mbcico", CFG.location, CFG.logfile, CFG.cico_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbcico", CFG.location, CFG.logfile, CFG.cico_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBCICO v%s", VERSION); diff --git a/mbcico/mbout.c b/mbcico/mbout.c index 6f3fed52..57b0ea16 100644 --- a/mbcico/mbout.c +++ b/mbcico/mbout.c @@ -231,7 +231,7 @@ int main(int argc, char *argv[]) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbout", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbout", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBOUT v%s", VERSION); Syslog(' ', cmd); diff --git a/mbfido/areamgr.c b/mbfido/areamgr.c index deaa0637..ef0c3d17 100644 --- a/mbfido/areamgr.c +++ b/mbfido/areamgr.c @@ -84,7 +84,7 @@ void A_Help(faddr *t, char *replyid) char *subject; faddr *ta; - Syslog('+', "AreaMgr: Help"); + Mgrlog("AreaMgr: Help"); subject = calloc(255, sizeof(char)); sprintf(subject,"AreaMgr Help"); @@ -141,22 +141,22 @@ void A_List(faddr *t, char *replyid, int Notify) MacroVars("Y", "s", ascfnode(f, 0xff)); switch (Notify) { - case LIST_NOTIFY: Syslog('+', "AreaMgr: Notify to %s", ascfnode(t, 0xff)); + case LIST_NOTIFY: Mgrlog("AreaMgr: Notify to %s", ascfnode(t, 0xff)); sprintf(subject,"AreaMgr Notify"); GetRpSubject("areamgr.notify.list",subject); fi = OpenMacro("areamgr.notify.list", nodes.Language, FALSE); break; - case LIST_LIST: Syslog('+', "AreaMgr: List"); + case LIST_LIST: Mgrlog("AreaMgr: List"); sprintf(subject,"AreaMgr list"); GetRpSubject("areamgr.list",subject); fi = OpenMacro("areamgr.list", nodes.Language, FALSE); break; - case LIST_QUERY: Syslog('+', "AreaMgr: Query"); + case LIST_QUERY: Mgrlog("AreaMgr: Query"); sprintf(subject,"AreaMgr Query"); GetRpSubject("areamgr.query",subject); fi = OpenMacro("areamgr.query", nodes.Language, FALSE); break; - case LIST_UNLINK: Syslog('+', "AreaMgr: Unlinked"); + case LIST_UNLINK: Mgrlog("AreaMgr: Unlinked"); sprintf(subject,"AreaMgr: Unlinked areas"); GetRpSubject("areamgr.unlink",subject); fi = OpenMacro("areamgr.unlink", nodes.Language, FALSE); @@ -327,12 +327,12 @@ void A_Flow(faddr *t, char *replyid, int Notify) MacroVars("sKyY", "sdss", nodes.Sysop, Notify, ascfnode(t, 0xff), ascfnode(f, 0xf)); if (Notify){ - Syslog('+', "AreaMgr: Flow report to %s", ascfnode(t, 0xff)); + Mgrlog("AreaMgr: Flow report to %s", ascfnode(t, 0xff)); sprintf(subject,"AreaMgr Notify Flow Report"); GetRpSubject("areamgr.notify.flow",subject); fi = OpenMacro("areamgr.notify.flow", nodes.Language, FALSE); }else{ - Syslog('+', "AreaMgr: Flow report"); + Mgrlog("AreaMgr: Flow report"); sprintf(subject,"AreaMgr Flow Report"); GetRpSubject("areamgr.flow",subject); fi = OpenMacro("areamgr.flow", nodes.Language, FALSE); @@ -476,7 +476,7 @@ void A_Status(faddr *t, char *replyid) subject = calloc(255, sizeof(char)); sprintf(subject,"AreaMgr Status"); - Syslog('+', "AreaMgr: Status"); + Mgrlog("AreaMgr: Status"); if (Miy == 0) i = 11; @@ -537,7 +537,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) faddr *b, *Temp; sysconnect Sys; - Syslog('+', "AreaMgr: \"%s\"", Area); + Mgrlog("AreaMgr: disconnect \"%s\"", Area); ShiftBuf(Area, 1); for (i=0; i < strlen(Area); i++ ) Area[i]=toupper(Area[i]); @@ -546,7 +546,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTFOUND",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " Area not found"); + Mgrlog(" Area not found"); MacroClear(); return; } @@ -563,7 +563,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTGROUP",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " Group %s not available for %s", mgroup.Name, ascfnode(t, 0x1f)); + Mgrlog(" Group %s not available for %s", mgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; } @@ -578,7 +578,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_BADADD",Area,ascfnode(t, 0x1f),"","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " %s may not disconnect from group %s", ascfnode(t, 0x1f), mgroup.Name); + Mgrlog(" %s may not disconnect from group %s", ascfnode(t, 0x1f), mgroup.Name); MacroClear(); return; } @@ -592,7 +592,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NC",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " %s is not connected to %s", ascfnode(t, 0x1f), Area); + Mgrlog(" %s is not connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; } @@ -603,7 +603,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) * Make sure to write an overview afterwards. */ a_list = TRUE; - Syslog('+', "Disconnected echo area %s", Area); + Mgrlog("Disconnected echo area %s", Area); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","OK_DISC",Area,"","","",""); MsgResult("areamgr.responses",tmp); @@ -614,7 +614,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTAVAIL",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', "Didn't disconnect %s from mandatory or cutoff echo area %s", ascfnode(t, 0x1f), Area); + Mgrlog("Didn't disconnect %s from mandatory or cutoff echo area %s", ascfnode(t, 0x1f), Area); MacroClear(); } @@ -629,7 +629,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) sysconnect Sys; FILE *gp; - Syslog('+', "AreaMgr: \"%s\"", printable(Area, 0)); + Mgrlog("AreaMgr: connect \"%s\"", printable(Area, 0)); if (Area[0] == '+') ShiftBuf(Area, 1); @@ -675,7 +675,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTFOUND",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', "Area %s not found", Area); + Mgrlog("Area %s not found", Area); MacroClear(); return; } @@ -693,7 +693,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTGROUP",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " Group %s not available for node %s", mgroup.Name, ascfnode(t, 0x1f)); + Mgrlog(" Group %s not available for node %s", mgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; } @@ -708,7 +708,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_BADADD",Area,ascfnode(t, 0x1f),"","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " %s may not connect to group %s", ascfnode(t, 0x1f), mgroup.Name); + Mgrlog(" %s may not connect to group %s", ascfnode(t, 0x1f), mgroup.Name); MacroClear(); return; } @@ -722,7 +722,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_ALREADY",Area,"","","",""); MsgResult("areamgr.responses",tmp); - Syslog('+', " %s is already connected to %s", ascfnode(t, 0x1f), Area); + Mgrlog(" %s is already connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; } @@ -733,7 +733,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) * Make sure to write an overview afterwards. */ a_list = TRUE; - Syslog('+', "Connected echo area %s", Area); + Mgrlog("Connected echo area %s", Area); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","OK_CONN",Area,aka2str(msgs.Aka),"","",""); MsgResult("areamgr.responses",tmp); @@ -761,14 +761,14 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp) if (Grp == NULL) { if (Connect) - Syslog('+', "AreaMgr: Connect All"); + Mgrlog("AreaMgr: Connect All"); else - Syslog('+', "AreaMgr: Disconnect All"); + Mgrlog("AreaMgr: Disconnect All"); } else { if (Connect) - Syslog('+', "AreaMgr: Connect group %s", Grp); + Mgrlog("AreaMgr: Connect group %s", Grp); else - Syslog('+', "AreaMgr: Disconnect group %s", Grp); + Mgrlog("AreaMgr: Disconnect group %s", Grp); } f = bestaka_s(t); @@ -835,7 +835,7 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp) Sys.receivefrom = TRUE; fseek(mp, - sizeof(Sys), SEEK_CUR); fwrite(&Sys, sizeof(Sys), 1, mp); - Syslog('+', "AreaMgr: Connected %s", msgs.Tag); + Mgrlog("AreaMgr: Connected %s", msgs.Tag); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","OK_CONN",msgs.Tag,aka2str(msgs.Aka),"","",""); MsgResult("areamgr.responses",tmp); @@ -855,7 +855,7 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp) memset(&Sys, 0, sizeof(Sys)); fseek(mp, - sizeof(Sys), SEEK_CUR); fwrite(&Sys, sizeof(Sys), 1, mp); - Syslog('+', "AreaMgr: Disconnected %s", msgs.Tag); + Mgrlog("AreaMgr: Disconnected %s", msgs.Tag); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","OK_DISC",msgs.Tag,"","","",""); MsgResult("areamgr.responses",tmp); @@ -901,9 +901,9 @@ void A_Pause(faddr *t, int Pause, FILE *tmp) char *temp; if (Pause) - Syslog('+', "AreaMgr: Pause"); + Mgrlog("AreaMgr: Pause"); else - Syslog('+', "AreaMgr: Resume"); + Mgrlog("AreaMgr: Resume"); f = bestaka_s(t); Syslog('m', "Bestaka for %s is %s", ascfnode(t, 0x1f), ascfnode(f, 0x1f)); @@ -928,7 +928,7 @@ void A_Pause(faddr *t, int Pause, FILE *tmp) Sys.pause = Pause; fseek(mp, - sizeof(Sys), SEEK_CUR); fwrite(&Sys, sizeof(Sys), 1, mp); - Syslog('+', "AreaMgr: %s area %s", Pause?"Pause":"Resume", msgs.Tag); + Mgrlog("AreaMgr: %s area %s", Pause?"Pause":"Resume", msgs.Tag); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssdsss","OK_PAUSE",msgs.Tag,Pause,"","",""); MsgResult("areamgr.responses",tmp); @@ -957,7 +957,7 @@ void A_Rescan(faddr *t, char *Area, FILE *tmp) CleanBuf(Area); for (i = 0; i < strlen(Area); i++ ) Area[i] = toupper(Area[i]); - Syslog('+', "AreaMgr: Rescan %s, MSGS=%lu", Area, a_msgs); + Mgrlog("AreaMgr: Rescan %s, MSGS=%lu", Area, a_msgs); result = RescanOne(t, Area, a_msgs); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); if (result == 0){ @@ -987,7 +987,7 @@ void A_Msgs(char *Buf, int skip) ShiftBuf(Buf, skip); CleanBuf(Buf); a_msgs = strtoul( Buf, (char **)NULL, 10 ); - Syslog('+', "AreaMgr: msgs %s ", Buf ); + Mgrlog("AreaMgr: msgs %s ", Buf ); } @@ -1003,7 +1003,7 @@ int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla if (SearchFidonet(f->zone)) f->domain = xstrcpy(fidonet.domain); - Syslog('+', "AreaMgr msg from %s", ascfnode(f, 0xff)); + Mgrlog("AreaMgr request from %s", ascfnode(f, 0xff)); /* * If the password failed, we return silently and don't respond. diff --git a/mbfido/createf.c b/mbfido/createf.c index 78daa110..a579dc53 100644 --- a/mbfido/createf.c +++ b/mbfido/createf.c @@ -389,9 +389,9 @@ int CheckTicGroup(char *Area, int SendUplink, faddr *f) free(buf); free(temp); if (f == NULL) - Syslog('+', "Auto created TIC area %s, group %s, bbs area %ld", tic.Name, tic.Group, AreaNr); + Mgrlog("Auto created TIC area %s, group %s, bbs area %ld", tic.Name, tic.Group, AreaNr); else - Syslog('+', "Auto created TIC area %s, group %s, bbs area %ld, for node %s", + Mgrlog("Auto created TIC area %s, group %s, bbs area %ld, for node %s", tic.Name, tic.Group, AreaNr, ascfnode(f, 0x1f)); return 0; diff --git a/mbfido/createm.c b/mbfido/createm.c index d05d4dfd..2f4e2075 100644 --- a/mbfido/createm.c +++ b/mbfido/createm.c @@ -264,9 +264,9 @@ int CheckEchoGroup(char *Area, int SendUplink, faddr *f) free(buf); free(temp); if (f == NULL) - Syslog('+', "Auto created echo %s, group %s, area %ld", msgs.Tag, msgs.Group, offset); + Mgrlog("Auto created echo %s, group %s, area %ld", msgs.Tag, msgs.Group, offset); else - Syslog('+', "Auto created echo %s, group %s, area %ld, for node %s", + Mgrlog("Auto created echo %s, group %s, area %ld, for node %s", msgs.Tag, msgs.Group, offset, ascfnode(f , 0x1f)); return 0; } /* if (strcmp(tag, Area) == 0) */ diff --git a/mbfido/filemgr.c b/mbfido/filemgr.c index d080982d..b299f68d 100644 --- a/mbfido/filemgr.c +++ b/mbfido/filemgr.c @@ -79,7 +79,7 @@ void F_Help(faddr *t, char *replyid) FILE *fp, *fi; char *subject; - Syslog('+', "FileMgr: Help"); + Mgrlog("FileMgr: Help"); subject=calloc(255,sizeof(char)); sprintf(subject,"FileMgr help"); GetRpSubject("filemgr.help",subject); @@ -130,22 +130,22 @@ void F_List(faddr *t, char *replyid, int Notify) MacroVars("Y", "s", ascfnode(f, 0xff)); switch (Notify) { - case LIST_NOTIFY: Syslog('+', "FileMgr: Notify to %s", ascfnode(t, 0xff)); + case LIST_NOTIFY: Mgrlog("FileMgr: Notify to %s", ascfnode(t, 0xff)); sprintf(subject,"FileMgr Notify"); GetRpSubject("filemgr.notify.list",subject); fi=OpenMacro("filemgr.notify.list", nodes.Language, FALSE); break; - case LIST_LIST: Syslog('+', "FileMgr: List"); + case LIST_LIST: Mgrlog("FileMgr: List"); sprintf(subject,"FileMgr list"); GetRpSubject("filemgr.list",subject); fi=OpenMacro("filemgr.list", nodes.Language, FALSE); break; - case LIST_QUERY: Syslog('+', "FileMgr: Query"); + case LIST_QUERY: Mgrlog("FileMgr: Query"); sprintf(subject,"FileMgr Query"); GetRpSubject("filemgr.query",subject); fi=OpenMacro("filemgr.query", nodes.Language, FALSE); break; - default: Syslog('+', "FileMgr: Unlinked"); + default: Mgrlog("FileMgr: Unlinked"); sprintf(subject,"FileMgr: Unlinked areas"); GetRpSubject("filemgr.unlink",subject); fi=OpenMacro("filemgr.unlink", nodes.Language, FALSE); @@ -296,7 +296,7 @@ void F_Status(faddr *t, char *replyid) subject = calloc(255, sizeof(char)); sprintf(subject,"FileMgr Status"); - Syslog('+', "FileMgr: Status"); + Mgrlog("FileMgr: Status"); if (Miy == 0) i = 11; else @@ -363,7 +363,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) faddr *b, *Temp; sysconnect Sys; - Syslog('+', "FileMgr: %s", Area); + Mgrlog("FileMgr: disconnect %s", Area); ShiftBuf(Area, 1); for (i = 0; i < strlen(Area); i++) Area[i] = toupper(Area[i]); @@ -389,7 +389,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTGROUP",Area,"","","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', " Group %s not available for %s", fgroup.Name, ascfnode(t, 0x1f)); + Mgrlog(" Group %s not available for %s", fgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; } @@ -404,7 +404,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_BADADD",Area,ascfnode(t, 0x1f),"","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', " %s may not disconnect from group %s", ascfnode(t, 0x1f), fgroup.Name); + Mgrlog(" %s may not disconnect from group %s", ascfnode(t, 0x1f), fgroup.Name); MacroClear(); return; } @@ -418,7 +418,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NC",Area,"","","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', " %s is not connected to %s", ascfnode(t, 0x1f), Area); + Mgrlog(" %s is not connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; } @@ -429,7 +429,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) * Make sure to write an overview afterwards */ f_list = TRUE; - Syslog('+', "Disconnected file area %s", Area); + Mgrlog("Disconnected file area %s", Area); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","OK_DISC",Area,"","","",""); MsgResult("filemgr.responses",tmp); @@ -440,7 +440,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTAVAIL",Area,"","","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', "Didn't disconnect %s from mandatory file area %s", ascfnode(t, 0x1f), Area); + Mgrlog("Didn't disconnect %s from mandatory file area %s", ascfnode(t, 0x1f), Area); MacroClear(); } @@ -455,7 +455,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) sysconnect Sys; FILE *gp; - Syslog('+', "FileMgr: %s", Area); + Mgrlog("FileMgr: connect %s", Area); if (Area[0] == '+') ShiftBuf(Area, 1); @@ -501,7 +501,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTFOUND",Area,"","","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', "Area %s not found", Area); + Mgrlog("Area %s not found", Area); MacroClear(); return; } @@ -519,7 +519,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTGROUP",Area,"","","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', " Group %s not available for %s", fgroup.Name, ascfnode(t, 0x1f)); + Mgrlog(" Group %s not available for %s", fgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; } @@ -534,7 +534,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_BADADD",Area,ascfnode(t, 0x1f),"","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', " Node %s may not connect to group %s", ascfnode(t, 0x1f), fgroup.Name); + Mgrlog(" Node %s may not connect to group %s", ascfnode(t, 0x1f), fgroup.Name); MacroClear(); return; } @@ -547,7 +547,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_ALREADY",Area,"","","",""); MsgResult("filemgr.responses",tmp); - Syslog('+', " %s is already connected to %s", ascfnode(t, 0x1f), Area); + Mgrlog(" %s is already connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; } @@ -558,7 +558,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) * Make sure to write an overview afterwards */ f_list = TRUE; - Syslog('+', "Connected to file area %s", Area); + Mgrlog("Connected to file area %s", Area); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","OK_CONN",Area,aka2str(tic.Aka),"","",""); MsgResult("filemgr.responses",tmp); @@ -586,14 +586,14 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp) if (Grp == NULL) { if (Connect) - Syslog('+', "FileMgr: Connect All"); + Mgrlog("FileMgr: Connect All"); else - Syslog('+', "FileMgr: Disconnect All"); + Mgrlog("FileMgr: Disconnect All"); } else { if (Connect) - Syslog('+', "FileMgr: Connect group %s", Grp); + Mgrlog("FileMgr: Connect group %s", Grp); else - Syslog('+', "FileMgr: Disconnect group %s", Grp); + Mgrlog("FileMgr: Disconnect group %s", Grp); } f = bestaka_s(t); @@ -654,7 +654,7 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp) Sys.sendto = TRUE; fseek(fp, - sizeof(Sys), SEEK_CUR); fwrite(&Sys, sizeof(Sys), 1, fp); - Syslog('+', "FileMgr: Connected %s", tic.Name); + Mgrlog("FileMgr: Connected %s", tic.Name); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","OK_CONN",tic.Name,aka2str(tic.Aka),"","",""); MsgResult("filemgr.responses",tmp); @@ -674,7 +674,7 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp) memset(&Sys, 0, sizeof(Sys)); fseek(fp, - sizeof(Sys), SEEK_CUR); fwrite(&Sys, sizeof(Sys), 1, fp); - Syslog('+', "FileMgr: Disconnected %s", tic.Name); + Mgrlog("FileMgr: Disconnected %s", tic.Name); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","OK_DISC",tic.Name,"","","",""); MsgResult("filemgr.responses",tmp); @@ -720,9 +720,9 @@ void F_Pause(faddr *t, int Pause, FILE *tmp) char *temp; if (Pause) - Syslog('+', "FileMgr: Pause"); + Mgrlog("FileMgr: Pause"); else - Syslog('+', "FileMgr: Resume"); + Mgrlog("FileMgr: Resume"); f = bestaka_s(t); Syslog('m', "Bestaka for %s is %s", ascfnode(t, 0x1f), ascfnode(f, 0x1f)); @@ -746,7 +746,7 @@ void F_Pause(faddr *t, int Pause, FILE *tmp) Sys.pause = Pause; fseek(fp, - sizeof(Sys), SEEK_CUR); fwrite(&Sys, sizeof(Sys), 1, fp); - Syslog('+', "FileMgr: %s area %s", Pause?"Pause":"Resume", tic.Name); + Mgrlog("FileMgr: %s area %s", Pause?"Pause":"Resume", tic.Name); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"FileMgr"); MacroVars("RABCDE", "ssdsss","OK_PAUSE",tic.Name,Pause,"","",""); MsgResult("filemgr.responses",tmp); @@ -777,7 +777,7 @@ void F_Message(faddr *t, char *Buf, FILE *tmp) UpdateNode(); SearchNodeFaddr(t); - Syslog('+', "FileMgr: Message %s", nodes.Message?"Yes":"No"); + Mgrlog("FileMgr: Message %s", nodes.Message?"Yes":"No"); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "sdssss","OK_MESSAGE",nodes.Message,"","","",""); MsgResult("filemgr.responses",tmp); @@ -803,7 +803,7 @@ void F_Tick(faddr *t, char *Buf, FILE *tmp) UpdateNode(); SearchNodeFaddr(t); - Syslog('+', "FileMgr: Tick %s, Advanced %s", nodes.Tic?"Yes":"No", nodes.AdvTic?"Yes":"No"); + Mgrlog("FileMgr: Tick %s, Advanced %s", nodes.Tic?"Yes":"No", nodes.AdvTic?"Yes":"No"); if (nodes.Tic) if (nodes.AdvTic){ MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); @@ -834,13 +834,14 @@ int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla if (SearchFidonet(f->zone)) f->domain = xstrcpy(fidonet.domain); - Syslog('+', "FileMgr msg from %s", ascfnode(f, 0xff)); + Mgrlog("FileMgr request from %s", ascfnode(f, 0xff)); /* * If the password failed, we return silently and don't respond. */ if ((!strlen(subj)) || (strcasecmp(subj, nodes.Fpasswd))) { WriteError("FileMgr: password expected \"%s\", got \"%s\"", nodes.Fpasswd, subj); + Mgrlog("FileMgr: password expected \"%s\", got \"%s\"", nodes.Fpasswd, subj); net_bad++; return FALSE; } diff --git a/mbfido/mbaff.c b/mbfido/mbaff.c index bb99c15c..8cfd0a9e 100644 --- a/mbfido/mbaff.c +++ b/mbfido/mbaff.c @@ -141,7 +141,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbaff", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbaff", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBAFF v%s", VERSION); diff --git a/mbfido/mbdiff.c b/mbfido/mbdiff.c index 9f6ceaa0..561a9651 100644 --- a/mbfido/mbdiff.c +++ b/mbfido/mbdiff.c @@ -166,7 +166,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbdiff", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbdiff", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBDIFF v%s", VERSION); diff --git a/mbfido/mbfido.c b/mbfido/mbfido.c index 42f38ef7..9a7eb406 100644 --- a/mbfido/mbfido.c +++ b/mbfido/mbfido.c @@ -425,7 +425,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbfido", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbfido", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBFIDO v%s", VERSION); diff --git a/mbfido/mbfile.c b/mbfido/mbfile.c index f2eda279..d86fc9bc 100644 --- a/mbfido/mbfile.c +++ b/mbfido/mbfile.c @@ -203,7 +203,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbfile", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbfile", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBFILE v%s", VERSION); diff --git a/mbfido/mbindex.c b/mbfido/mbindex.c index bbbbf54e..5c0442e9 100644 --- a/mbfido/mbindex.c +++ b/mbfido/mbindex.c @@ -250,7 +250,7 @@ int main(int argc,char *argv[]) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbindex", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbindex", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBINDEX v%s", VERSION); diff --git a/mbfido/mbmsg.c b/mbfido/mbmsg.c index c65d9636..2defdf45 100644 --- a/mbfido/mbmsg.c +++ b/mbfido/mbmsg.c @@ -156,7 +156,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbmsg", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbmsg", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBMSG v%s", VERSION); diff --git a/mbfido/mbseq.c b/mbfido/mbseq.c index 3643d7ab..a9a51bc0 100644 --- a/mbfido/mbseq.c +++ b/mbfido/mbseq.c @@ -54,8 +54,7 @@ int main(int argc, char **argv) pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbseq", CFG.location, - CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbseq", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBSEQ v%s", VERSION); diff --git a/mbfido/mgrutil.c b/mbfido/mgrutil.c index 46635d3c..9b62b083 100644 --- a/mbfido/mgrutil.c +++ b/mbfido/mgrutil.c @@ -247,7 +247,7 @@ void MgrPasswd(faddr *t, char *Buf, FILE *tmp, int Len, int mgr) if ((strlen(Buf) < 3) || (strlen(Buf) > 15)) { MacroVars("RABCDE", "ssssss",(char *)"ERR_PASS_LEN",(char *)"",(char *)"",(char *)"",(char *)"",(char *)""); MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp); - Syslog('+', "XxxxMgr: Password length %d, not changed", strlen(Buf)); + Mgrlog("%s: Password length %d, not changed", mgr?(char *)"Filemgr":(char *)"Areamgr", strlen(Buf)); return; } @@ -255,7 +255,7 @@ void MgrPasswd(faddr *t, char *Buf, FILE *tmp, int Len, int mgr) strncpy(nodes.Apasswd, tu(Buf), 15); MacroVars("RABCDE", "ssssss",(char *)"OK_PASS",nodes.Apasswd,(char *)"",(char *)"",(char *)"",(char *)""); MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp); - Syslog('+', "XxxxMgr: Password \"%s\" for node %s", nodes.Apasswd, ascfnode(t, 0x1f)); + Mgrlog("%s: Password \"%s\" for node %s", mgr?(char *)"Filemgr":(char *)"Areamgr", nodes.Apasswd, ascfnode(t, 0x1f)); MacroClear(); UpdateNode(); SearchNodeFaddr(t); @@ -283,7 +283,7 @@ void MgrNotify(faddr *t, char *Buf, FILE *tmp, int mgr) UpdateNode(); SearchNodeFaddr(t); - Syslog('+', "XxxxMgr: Notify %s", nodes.Notify?"Yes":"No"); + Mgrlog("%s: Notify %s", mgr?(char *)"Filemgr":(char *)"Areamgr", nodes.Notify?"Yes":"No"); MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,mgr?(char *)"Filemgr":(char *)"Areamgr"); MacroVars("RABCDE", "sdssss",(char *)"NOTIFY",nodes.Notify,(char *)"",(char *)"",(char *)"",(char *)""); MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp); @@ -510,7 +510,7 @@ int Areas(void) sysconnect System; faddr *From, *To; - Syslog('+', "Process areas taglists"); + Mgrlog("Process areas taglists"); if (!do_quiet) { colour(3, 0); @@ -642,13 +642,13 @@ int Areas(void) fseek(fp, - msgshdr.recsize, SEEK_CUR); sprintf(temp, "%s.jhr", msgs.Base); if (strlen(msgs.Base) && (file_size(temp) != 1024)) { - Syslog('+', "Marking message area %d, %s read-only", + Mgrlog("Marking message area %d, %s read-only", ((ftell(fp) - msgshdr.hdrsize) / (msgshdr.recsize + msgshdr.syssize)) + 1, msgs.Tag); msgs.MsgKinds = RONLY; // Area read-only sprintf(msgs.Group, "DELETED"); // Make groupname invalid } else { - Syslog('+', "Removing empty message area %d, %s", + Mgrlog("Removing empty message area %d, %s", ((ftell(fp) - msgshdr.hdrsize) / (msgshdr.recsize + msgshdr.syssize)) + 1, msgs.Tag); memset(&msgs, 0, sizeof(msgs)); @@ -697,7 +697,7 @@ int Areas(void) if (UplinkRequest(To, From, FALSE, cmd)) { WriteError("Uplink request failed"); } else { - Syslog('+', "AreaMgr request sent to %s", aka2str(mgroup.UpLink)); + Mgrlog("AreaMgr request sent to %s", aka2str(mgroup.UpLink)); } tidy_faddr(From); tidy_faddr(To); @@ -940,7 +940,7 @@ int Areas(void) fclose(ap); unlink(temp); rename(buf, temp); - Syslog('+', "Purged %d TIC records", count); + Mgrlog("Purged %d TIC records", count); } } @@ -955,7 +955,7 @@ int Areas(void) if (UplinkRequest(To, From, TRUE, cmd)) { WriteError("Uplink request failed"); } else { - Syslog('+', "AreaMgr request sent to %s", aka2str(fgroup.UpLink)); + Mgrlog("AreaMgr request sent to %s", aka2str(fgroup.UpLink)); } tidy_faddr(From); tidy_faddr(To); diff --git a/mbsebbs/mball.c b/mbsebbs/mball.c index f144e784..4911ed76 100644 --- a/mbsebbs/mball.c +++ b/mbsebbs/mball.c @@ -178,7 +178,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mball", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mball", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBALL v%s", VERSION); diff --git a/mbsebbs/mbnewusr.c b/mbsebbs/mbnewusr.c index 08931076..6fd39633 100644 --- a/mbsebbs/mbnewusr.c +++ b/mbsebbs/mbnewusr.c @@ -115,7 +115,8 @@ int main(int argc, char **argv) * who is at the other end of the line, so that's what we tell. */ do_quiet = TRUE; - InitClient((char *)"Unknown", (char *)"mbnewusr", (char *)"Unknown", CFG.logfile, CFG.bbs_loglevel, CFG.error_log); + InitClient((char *)"Unknown", (char *)"mbnewusr", (char *)"Unknown", + CFG.logfile, CFG.bbs_loglevel, CFG.error_log, CFG.mgrlog); IsDoing("Loging in"); Syslog(' ', " "); diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c index ec2482c8..51bb956d 100644 --- a/mbsebbs/mbsebbs.c +++ b/mbsebbs/mbsebbs.c @@ -105,8 +105,7 @@ int main(int argc, char **argv) * Initialize this client with the server. */ do_quiet = TRUE; - InitClient(sUnixName, (char *)"mbsebbs", (char *)"Unknown", - CFG.logfile, CFG.bbs_loglevel, CFG.error_log); + InitClient(sUnixName, (char *)"mbsebbs", (char *)"Unknown", CFG.logfile, CFG.bbs_loglevel, CFG.error_log, CFG.mgrlog); IsDoing("Loging in"); Syslog(' ', " "); diff --git a/mbsebbs/mbstat.c b/mbsebbs/mbstat.c index aff38982..012a8d9f 100644 --- a/mbsebbs/mbstat.c +++ b/mbsebbs/mbstat.c @@ -156,7 +156,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbstat", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbstat", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); usleep(1); Syslog(' ', " "); diff --git a/mbsebbs/mbuser.c b/mbsebbs/mbuser.c index 01930540..99ff67e8 100644 --- a/mbsebbs/mbuser.c +++ b/mbsebbs/mbuser.c @@ -101,7 +101,7 @@ int main(int argc, char **argv) ProgName(); pw = getpwuid(getuid()); - InitClient(pw->pw_name, (char *)"mbuser", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log); + InitClient(pw->pw_name, (char *)"mbuser", CFG.location, CFG.logfile, CFG.util_loglevel, CFG.error_log, CFG.mgrlog); Syslog(' ', " "); Syslog(' ', "MBUSER v%s", VERSION); Syslog(' ', cmd);