diff --git a/ChangeLog b/ChangeLog index 7d456bba..83e8d62f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,10 @@ v0.61.3 25-Jul-2004 Fixed logging of 0 articles in scannews. With the command "mbfido areas" without the -q option the user must confirm this action. + For netmails to uplinks for areamgr/filemgr changes, the wrong + password was used. + In large areamgr/filemgr responses each 2048 bytes was an extra + inserted. mbfile: Fixed a bug where "mbfile k p i" didn't give the help screen. diff --git a/mbfido/areamgr.c b/mbfido/areamgr.c index da95eb84..1498b95a 100644 --- a/mbfido/areamgr.c +++ b/mbfido/areamgr.c @@ -557,7 +557,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) if (!SearchMsgs(Area)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTFOUND",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" Area not found"); MacroClear(); return; @@ -574,7 +574,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) if (Group == NULL) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTGROUP",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" Group %s not available for %s", mgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; @@ -589,7 +589,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) if (i >= METRIC_NET) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_BADADD",Area,ascfnode(t, 0x1f),"","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" %s may not disconnect from group %s", ascfnode(t, 0x1f), mgroup.Name); MacroClear(); return; @@ -603,7 +603,7 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) if (!MsgSystemConnected(Sys)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NC",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" %s is not connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; @@ -618,14 +618,14 @@ void A_Disconnect(faddr *t, char *Area, FILE *tmp) 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); + MsgResult("areamgr.responses",tmp,'\n'); MacroClear(); return; } MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTAVAIL",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog("Didn't disconnect %s from mandatory or cutoff echo area %s", ascfnode(t, 0x1f), Area); MacroClear(); } @@ -671,7 +671,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) if (CheckEchoGroup(Area, mgroup.UpLink.zone, t) == 0) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_FORWARD",Area,aka2str(mgroup.UpLink),"","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); break; } } @@ -686,7 +686,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) if (!SearchMsgs(Area)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTFOUND",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog("Area %s not found", Area); MacroClear(); return; @@ -704,7 +704,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) if (Group == NULL) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTGROUP",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" Group %s not available for node %s", mgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; @@ -719,7 +719,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) if (i >= METRIC_NET) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_BADADD",Area,ascfnode(t, 0x1f),"","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" %s may not connect to group %s", ascfnode(t, 0x1f), mgroup.Name); MacroClear(); return; @@ -731,7 +731,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) * If node has no access by flags, we lie and say "Area not found" */ MacroVars("RABCDE", "ssssss","ERR_CONN_NOTFOUND",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" %s has no access to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; @@ -745,7 +745,7 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) if (MsgSystemConnected(Sys)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_ALREADY",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); Mgrlog(" %s is already connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; @@ -760,13 +760,13 @@ void A_Connect(faddr *t, char *Area, FILE *tmp) 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); + MsgResult("areamgr.responses",tmp,'\n'); MacroClear(); return; } MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTAVAIL",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); WriteError("Can't connect node %s to echo area %s", ascfnode(t, 0x1f), Area); MacroClear(); } @@ -862,7 +862,7 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp) 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); + MsgResult("areamgr.responses",tmp,'\n'); MacroClear(); a_list = TRUE; break; @@ -882,7 +882,7 @@ void A_All(faddr *t, int Connect, FILE *tmp, char *Grp) 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); + MsgResult("areamgr.responses",tmp,'\n'); MacroClear(); a_list = TRUE; } @@ -955,7 +955,7 @@ void A_Pause(faddr *t, int Pause, FILE *tmp) 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); + MsgResult("areamgr.responses",tmp,'\n'); a_list = TRUE; } tidy_faddr(Temp); @@ -986,16 +986,16 @@ void A_Rescan(faddr *t, char *Area, FILE *tmp) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Areamgr"); if (result == 0){ MacroVars("RABCDE", "ssdsss","OK_RESCAN",Area,a_msgs,"","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); } else if (result == 1) { MacroVars("RABCDE", "ssssss","ERR_RESCAN_UNK",Area,"","","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); } else if (result == 2) { MacroVars("RABCDE", "ssssss","ERR_RESCAN_NOTAVAIL",Area,ascfnode(t, 0x1f),"","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); } else { MacroVars("RABCDE", "ssssss","ERR_RESCAN_FATAL",Area,ascfnode(t, 0x1f),"","",""); - MsgResult("areamgr.responses",tmp); + MsgResult("areamgr.responses",tmp,'\n'); } MacroClear(); } @@ -1137,12 +1137,11 @@ int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla GetRpSubject("areamgr.responses",subject); if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", subject, replyid)) != NULL) { MacroVars("RABCDE", "ssssss","WELLCOME","","","","",""); - MsgResult("areamgr.responses",np); + MsgResult("areamgr.responses",np,'\r'); fprintf(np, "\r"); fseek(tmp, 0, SEEK_SET); while ((fgets(Buf, MAX_LINE_LENGTH, tmp)) != NULL) { - Syslogp('-', printable(Buf, 0)); while ((Buf[strlen(Buf) - 1]=='\n') || (Buf[strlen(Buf) - 1]=='\r')) { Buf[strlen(Buf) - 1] = '\0'; } @@ -1150,7 +1149,7 @@ int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla } fprintf(np, "\r"); MacroVars("RABCDE", "ssssss","GOODBYE","","","","",""); - MsgResult("areamgr.responses",np); + MsgResult("areamgr.responses",np,'\r'); fprintf(np, "\r%s\r", TearLine()); CloseMail(np, t); } else diff --git a/mbfido/filemgr.c b/mbfido/filemgr.c index 019ff693..b51eff7c 100644 --- a/mbfido/filemgr.c +++ b/mbfido/filemgr.c @@ -364,7 +364,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) if (!SearchTic(Area)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTFOUND",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Syslog('+', " Area not found"); MacroClear(); return; @@ -381,7 +381,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) if (Group == NULL) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTGROUP",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" Group %s not available for %s", fgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; @@ -396,7 +396,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) if (i >= METRIC_NET) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_BADADD",Area,ascfnode(t, 0x1f),"","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" %s may not disconnect from group %s", ascfnode(t, 0x1f), fgroup.Name); MacroClear(); return; @@ -410,7 +410,7 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) if (!TicSystemConnected(Sys)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NC",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" %s is not connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; @@ -425,14 +425,14 @@ void F_Disconnect(faddr *t, char *Area, FILE *tmp) 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); + MsgResult("filemgr.responses",tmp,'\n'); MacroClear(); return; } MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_DISC_NOTAVAIL",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog("Didn't disconnect %s from mandatory file area %s", ascfnode(t, 0x1f), Area); MacroClear(); } @@ -478,7 +478,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) if (CheckTicGroup(Area, fgroup.UpLink.zone, t) == 0) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_FORWARD",Area,aka2str(fgroup.UpLink),"","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); break; } } @@ -493,7 +493,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) if (!SearchTic(Area)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTFOUND",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog("Area %s not found", Area); MacroClear(); return; @@ -511,7 +511,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) if (Group == NULL) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, "Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTGROUP",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" Group %s not available for %s", fgroup.Name, ascfnode(t, 0x1f)); MacroClear(); return; @@ -526,7 +526,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) if (i >= METRIC_NET) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_BADADD",Area,ascfnode(t, 0x1f),"","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" Node %s may not connect to group %s", ascfnode(t, 0x1f), fgroup.Name); MacroClear(); return; @@ -538,7 +538,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) * If node has no access by flags, we lie and say "Area not found" */ MacroVars("RABCDE", "ssssss","ERR_CONN_NOTFOUND",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" %s has no access to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; @@ -551,7 +551,7 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) if (TicSystemConnected(Sys)) { MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_ALREADY",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); Mgrlog(" %s is already connected to %s", ascfnode(t, 0x1f), Area); MacroClear(); return; @@ -566,13 +566,13 @@ void F_Connect(faddr *t, char *Area, FILE *tmp) 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); + MsgResult("filemgr.responses",tmp,'\n'); MacroClear(); return; } MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "ssssss","ERR_CONN_NOTAVAIL",Area,"","","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); WriteError("Can't connect node %s to file area %s", ascfnode(t, 0x1f), Area); MacroClear(); } @@ -662,7 +662,7 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp) 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); + MsgResult("filemgr.responses",tmp,'\n'); MacroClear(); f_list = TRUE; break; @@ -682,7 +682,7 @@ void F_All(faddr *t, int Connect, FILE *tmp, char *Grp) 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); + MsgResult("filemgr.responses",tmp,'\n'); MacroClear(); f_list = TRUE; } @@ -754,7 +754,7 @@ void F_Pause(faddr *t, int Pause, FILE *tmp) 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); + MsgResult("filemgr.responses",tmp,'\n'); f_list = TRUE; } tidy_faddr(Temp); @@ -785,7 +785,7 @@ void F_Message(faddr *t, char *Buf, FILE *tmp) 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); + MsgResult("filemgr.responses",tmp,'\n'); MacroClear(); } @@ -813,15 +813,15 @@ void F_Tick(faddr *t, char *Buf, FILE *tmp) if (nodes.AdvTic){ MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "sddsss","OK_TIC_ADV",nodes.Tic,nodes.AdvTic,"","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); }else{ MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "sddsss","OK_TIC_NORM",nodes.Tic,nodes.AdvTic,"","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); }else{ MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop,"Filemgr"); MacroVars("RABCDE", "sddsss","OK_TIC_OFF",nodes.Tic,nodes.AdvTic,"","",""); - MsgResult("filemgr.responses",tmp); + MsgResult("filemgr.responses",tmp,'\n'); } MacroClear(); } @@ -944,7 +944,7 @@ int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla GetRpSubject("filemgr.responses",subject); if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", subject, replyid)) != NULL) { MacroVars("RABCDE", "ssssss","WELLCOME","","","","",""); - MsgResult("filemgr.responses",np); + MsgResult("filemgr.responses",np,'\r'); fprintf(np, "\r"); fseek(tmp, 0, SEEK_SET); @@ -957,7 +957,7 @@ int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla fprintf(np, "\r"); MacroVars("RABCDE", "ssssss","GOODBYE","","","","",""); - MsgResult("filemgr.responses",np); + MsgResult("filemgr.responses",np,'\r'); fprintf(np, "\r%s\r", TearLine()); CloseMail(np, t); } else diff --git a/mbfido/mgrutil.c b/mbfido/mgrutil.c index 8696a7b7..b579f047 100644 --- a/mbfido/mgrutil.c +++ b/mbfido/mgrutil.c @@ -241,7 +241,7 @@ void MgrPasswd(faddr *t, char *Buf, FILE *tmp, int Len, int mgr) MacroVars("SsP", "sss", CFG.sysop_name, nodes.Sysop, mgr?(char *)"Filemgr":(char *)"Areamgr"); 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); + MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp,'\n'); Mgrlog("%s: Password length %d, not changed", mgr?(char *)"Filemgr":(char *)"Areamgr", strlen(Buf)); return; } @@ -249,7 +249,7 @@ void MgrPasswd(faddr *t, char *Buf, FILE *tmp, int Len, int mgr) memset(&nodes.Apasswd, 0, sizeof(nodes.Apasswd)); 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); + MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp,'\n'); Mgrlog("%s: Password \"%s\" for node %s", mgr?(char *)"Filemgr":(char *)"Areamgr", nodes.Apasswd, ascfnode(t, 0x1f)); MacroClear(); UpdateNode(); @@ -281,7 +281,7 @@ void MgrNotify(faddr *t, char *Buf, FILE *tmp, int mgr) 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); + MsgResult(mgr?"filemgr.responses":"areamgr.responses",tmp,'\n'); MacroClear(); } @@ -332,20 +332,24 @@ int UplinkRequest(faddr *t, faddr *From, int FileMgr, char *cmd) return 2; } mgrname = xstrcpy(nodes.UplFmgrPgm); + if (strlen(nodes.UplFmgrPass) == 0) { + Syslog('!', "No FileMgr password set for node %s", aka2str(Dest)); + return 3; + } + subj = xstrcpy(nodes.UplFmgrPass); } else { if (strlen(nodes.UplAmgrPgm) == 0) { Syslog('!', "AreaMgr program not defined in setup of node %s", aka2str(Dest)); return 2; } mgrname = xstrcpy(nodes.UplAmgrPgm); + if (strlen(nodes.UplAmgrPass) == 0) { + Syslog('!', "No AreaMgr password set for node %s", aka2str(Dest)); + return 3; + } + subj = xstrcpy(nodes.UplAmgrPass); } - if (strlen(nodes.Apasswd) == 0) { - Syslog('!', "No %s password set for node %s", mgrname, aka2str(Dest)); - return 3; - } - subj = xstrcpy(nodes.Apasswd); - Mgrlog("Sending uplink request from %s to \"%s\" at %s", aka2str(Orig), mgrname, ascfnode(t, 0x1f)); Now = time(NULL) - (gmt_offset((time_t)0) * 60); @@ -456,7 +460,7 @@ void GetRpSubject(const char *report, char* subject) -int MsgResult(const char * report, FILE *fo) +int MsgResult(const char * report, FILE *fo, char eol) { FILE *fi; char *temp, *resp; @@ -470,7 +474,7 @@ int MsgResult(const char * report, FILE *fo) if (temp[0] != '#') { strncpy(resp, ParseMacro(temp, &res), 80); if ((res == 0) && strlen(resp)) - fprintf(fo,"%s\r",ParseMacro(temp,&res)); + fprintf(fo,"%s%c",ParseMacro(temp,&res), eol); } } fclose(fi); diff --git a/mbfido/mgrutil.h b/mbfido/mgrutil.h index 31ba595b..7735c2c0 100644 --- a/mbfido/mgrutil.h +++ b/mbfido/mgrutil.h @@ -23,7 +23,7 @@ typedef struct _AreaList { void MacroRead(FILE *, FILE *); -int MsgResult(const char *, FILE * ); +int MsgResult(const char *, FILE *, char); void GetRpSubject(const char *, char*); void WriteMailGroups(FILE *, faddr *);