Fixed ticfile crash thanks to BG garbage

This commit is contained in:
Michiel Broek 2002-08-16 20:50:28 +00:00
parent 3cd3c9124f
commit 7fb1a3106f
8 changed files with 49 additions and 28 deletions

View File

@ -51,6 +51,9 @@ v0.35.03 06-Jul-2002
Removed debug logline with extract of FILE_ID.DIZ. Removed debug logline with extract of FILE_ID.DIZ.
When a file is imported with a name that is already present, When a file is imported with a name that is already present,
the existing filerecord is updated and not replaced. the existing filerecord is updated and not replaced.
There are people using M$ wordprocessors to create TIC files,
there is now better filtering to get that garbage out of the
received tic files. We will forward plain ascii of course.
newuser: newuser:
Check for Unix accounts is now case sensitive. Check for Unix accounts is now case sensitive.

View File

@ -186,7 +186,7 @@ filemgr.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/u
hash.o: ../config.h ../lib/libs.h ../lib/memwatch.h hash.h lhash.h hash.o: ../config.h ../lib/libs.h ../lib/memwatch.h hash.h lhash.h
mbaff.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h announce.h filefind.h mbaff.h mbaff.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h announce.h filefind.h mbaff.h
mbseq.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbseq.h mbseq.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbseq.h
notify.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbnode.h filemgr.h areamgr.h sendmail.h notify.h notify.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbnode.h filemgr.h areamgr.h sendmail.h mgrutil.h notify.h
postnetmail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/common.h ../lib/records.h ../lib/dbcfg.h ../lib/dbuser.h ../lib/dbnode.h ../lib/dbftn.h ../lib/clcomm.h tracker.h addpkt.h storenet.h ftn2rfc.h areamgr.h filemgr.h ping.h bounce.h postemail.h postnetmail.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/common.h ../lib/records.h ../lib/dbcfg.h ../lib/dbuser.h ../lib/dbnode.h ../lib/dbftn.h ../lib/clcomm.h tracker.h addpkt.h storenet.h ftn2rfc.h areamgr.h filemgr.h ping.h bounce.h postemail.h
scannews.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h storeecho.h rfc2ftn.h scannews.h scannews.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h mkftnhdr.h hash.h rollover.h storeecho.h rfc2ftn.h scannews.h
tosspkt.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h tosspkt.h postnetmail.h postecho.h rollover.h createm.h tosspkt.o: ../config.h ../lib/libs.h ../lib/memwatch.h ../lib/structs.h ../lib/users.h ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/dbftn.h tosspkt.h postnetmail.h postecho.h rollover.h createm.h

View File

@ -51,10 +51,6 @@
#include "createm.h" #include "createm.h"
#include "areamgr.h" #include "areamgr.h"
#define LIST_LIST 0
#define LIST_NOTIFY 1
#define LIST_QUERY 2
#define LIST_UNLINK 3
@ -97,7 +93,10 @@ void A_Help(faddr *t, char *replyid)
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", subject , replyid)) != NULL) { if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", subject , replyid)) != NULL) {
if ((fi = OpenMacro("areamgr.help", nodes.Language, FALSE)) != NULL ) { if ((fi = OpenMacro("areamgr.help", nodes.Language, FALSE)) != NULL ) {
ta = bestaka_s(t); ta = bestaka_s(t);
MacroVars("sAYP", "ssss", nodes.Sysop, "Areamgr", ascfnode(ta, 0xf), nodes.Apasswd ); MacroVars("s", "s", nodes.Sysop);
MacroVars("A", "s", (char *)"Areamgr");
MacroVars("Y", "s", ascfnode(ta, 0xff));
MacroVars("P", "s", nodes.Apasswd);
tidy_faddr(ta); tidy_faddr(ta);
MacroRead(fi, fp); MacroRead(fi, fp);
fclose(fi); fclose(fi);
@ -136,7 +135,10 @@ void A_List(faddr *t, char *replyid, int Notify)
subject = calloc(255, sizeof(char)); subject = calloc(255, sizeof(char));
f = bestaka_s(t); f = bestaka_s(t);
MacroVars("sKyY", "sdss", nodes.Sysop, Notify, ascfnode(t, 0xff), ascfnode(f, 0xf)); MacroVars("s", "s", nodes.Sysop);
MacroVars("K", "d", Notify);
MacroVars("y", "s", ascfnode(t, 0xff));
MacroVars("Y", "s", ascfnode(f, 0xff));
switch (Notify) { switch (Notify) {
case LIST_NOTIFY: Syslog('+', "AreaMgr: Notify to %s", ascfnode(t, 0xff)); case LIST_NOTIFY: Syslog('+', "AreaMgr: Notify to %s", ascfnode(t, 0xff));
@ -1140,7 +1142,7 @@ int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla
A_Query(f, replyid); A_Query(f, replyid);
if (a_list) if (a_list)
A_List(f, replyid, FALSE); A_List(f, replyid, LIST_LIST);
if (a_flow) if (a_flow)
A_Flow(f, replyid, FALSE); A_Flow(f, replyid, FALSE);

View File

@ -50,10 +50,6 @@
#include "createf.h" #include "createf.h"
#include "filemgr.h" #include "filemgr.h"
#define LIST_LIST 0
#define LIST_NOTIFY 1
#define LIST_QUERY 2
#define LIST_UNLINK 3
/* /*
@ -90,7 +86,10 @@ void F_Help(faddr *t, char *replyid)
if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", subject, replyid)) != NULL) { if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", subject, replyid)) != NULL) {
if ((fi = OpenMacro("filemgr.help", nodes.Language, FALSE)) != NULL ){ if ((fi = OpenMacro("filemgr.help", nodes.Language, FALSE)) != NULL ){
MacroVars("sAYP", "ssss", nodes.Sysop, (char *)"Filemgr", ascfnode(bestaka_s(t), 0xf), nodes.Fpasswd ); MacroVars("s", "s", nodes.Sysop);
MacroVars("A", "s", (char *)"Filemgr");
MacroVars("Y", "s", ascfnode(bestaka_s(t), 0xf));
MacroVars("P", "s", nodes.Fpasswd);
MacroRead(fi, fp); MacroRead(fi, fp);
MacroClear(); MacroClear();
fclose(fi); fclose(fi);
@ -125,7 +124,10 @@ void F_List(faddr *t, char *replyid, int Notify)
subject = calloc(255, sizeof(char)); subject = calloc(255, sizeof(char));
f = bestaka_s(t); f = bestaka_s(t);
MacroVars("sKyY", "sdss", nodes.Sysop, Notify, ascfnode(t, 0xff), ascfnode(f, 0xf)); MacroVars("s", "s", nodes.Sysop);
MacroVars("K", "d", Notify);
MacroVars("y", "s", ascfnode(t, 0xff));
MacroVars("Y", "s", ascfnode(f, 0xff));
switch (Notify) { switch (Notify) {
case LIST_NOTIFY: Syslog('+', "FileMgr: Notify to %s", ascfnode(t, 0xff)); case LIST_NOTIFY: Syslog('+', "FileMgr: Notify to %s", ascfnode(t, 0xff));
@ -207,7 +209,9 @@ void F_List(faddr *t, char *replyid, int Notify)
if ((!strcmp(fgroup.Name, Group)) && if ((!strcmp(fgroup.Name, Group)) &&
(g->zone == f->zone) && (g->net == f->net) && (g->node == f->node) && (g->point == f->point)) { (g->zone == f->zone) && (g->net == f->net) && (g->node == f->node) && (g->point == f->point)) {
SubTot = 0; SubTot = 0;
MacroVars("GJI", "sss",fgroup.Name, fgroup.Comment, aka2str(fgroup.UseAka) ); MacroVars("G", "s", fgroup.Name);
MacroVars("J", "s", fgroup.Comment);
MacroVars("I", "s", aka2str(fgroup.UseAka));
fsetpos(fi,&fileptr); fsetpos(fi,&fileptr);
MacroRead(fi, qp); MacroRead(fi, qp);
fgetpos(fi,&fileptr1); fgetpos(fi,&fileptr1);
@ -236,13 +240,13 @@ void F_List(faddr *t, char *replyid, int Notify)
if ( (Notify == LIST_LIST) if ( (Notify == LIST_LIST)
|| (Notify == LIST_NOTIFY) || (Notify == LIST_NOTIFY)
|| ((Notify == LIST_QUERY) && ((Stat[0]=='S') || (Stat[1]=='R'))) || ((Notify == LIST_QUERY) && ((Stat[0]=='S') || (Stat[1]=='R')))
|| ((Notify >= LIST_UNLINK) && ((Stat[0]!='S') && (Stat[1]!='R')))){ || ((Notify >= LIST_UNLINK) && ((Stat[0]!='S') && (Stat[1]!='R')))) {
MacroVars("XDEsrp", "sssddd", MacroVars("X", "s", Stat);
Stat, tic.Name, tic.Comment, MacroVars("D", "s", tic.Name);
(Stat[0] == 'S'), MacroVars("E", "s", tic.Comment);
(Stat[1] == 'R'), MacroVars("s", "d", (Stat[0] == 'S'));
(Stat[2] == 'P') MacroVars("r", "d", (Stat[1] == 'R'));
); MacroVars("p", "d", (Stat[2] == 'P'));
fsetpos(fi,&fileptr1); fsetpos(fi,&fileptr1);
MacroRead(fi, qp); MacroRead(fi, qp);
fgetpos(fi,&fileptr2); fgetpos(fi,&fileptr2);
@ -964,7 +968,7 @@ int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int fla
F_Query(f, replyid); F_Query(f, replyid);
if (f_list) if (f_list)
F_List(f, replyid, FALSE); F_List(f, replyid, LIST_LIST);
if (f_unlnk) if (f_unlnk)
F_Unlinked(f, replyid); F_Unlinked(f, replyid);

View File

@ -4,6 +4,13 @@
#define _MGRUTIL_H #define _MGRUTIL_H
#define LIST_LIST 0
#define LIST_NOTIFY 1
#define LIST_QUERY 2
#define LIST_UNLINK 3
/* /*
* Linked list for atea areas create * Linked list for atea areas create
*/ */

View File

@ -42,6 +42,7 @@
#include "filemgr.h" #include "filemgr.h"
#include "areamgr.h" #include "areamgr.h"
#include "sendmail.h" #include "sendmail.h"
#include "mgrutil.h"
#include "notify.h" #include "notify.h"
@ -147,8 +148,8 @@ int Notify(char *Options)
F_Status(Tmp, NULL); F_Status(Tmp, NULL);
A_Status(Tmp, NULL); A_Status(Tmp, NULL);
} }
F_List(Tmp, NULL, TRUE); F_List(Tmp, NULL, LIST_NOTIFY);
A_List(Tmp, NULL, TRUE); A_List(Tmp, NULL, LIST_NOTIFY);
A_Flow(Tmp, NULL, TRUE); A_Flow(Tmp, NULL, TRUE);
tidy_faddr(Tmp); tidy_faddr(Tmp);
notify++; notify++;

View File

@ -603,8 +603,12 @@ int ProcessTic(fa_list *sbl)
strcpy(TDesc, TIC.TicIn.Desc); strcpy(TDesc, TIC.TicIn.Desc);
while (strlen(TDesc) > 48) { while (strlen(TDesc) > 48) {
j = 48; j = 48;
while (TDesc[j] != ' ') while ((TDesc[j] != ' ') && (j > 0))
j--; j--;
if (j == 0) {
Syslog('f', "Panic, no spaces");
j = 47;
}
strncpy(TIC.File_Id[TIC.File_Id_Ct], TDesc, j); strncpy(TIC.File_Id[TIC.File_Id_Ct], TDesc, j);
Syslog('f', "%2d/%2d: \"%s\"", TIC.File_Id_Ct, j, TIC.File_Id[TIC.File_Id_Ct]); Syslog('f', "%2d/%2d: \"%s\"", TIC.File_Id_Ct, j, TIC.File_Id[TIC.File_Id_Ct]);
TIC.File_Id_Ct++; TIC.File_Id_Ct++;

View File

@ -209,8 +209,8 @@ int LoadTic(char *inb, char *tfn)
Temp[0] = '\0'; Temp[0] = '\0';
j = 0; j = 0;
for (i = 0; i < strlen(Buf); i++) for (i = 0; i < strlen(Buf); i++)
if (isprint(Buf[i])) { if (isprint(Buf[i] & 0x7f)) {
Temp[j] = Buf[i]; Temp[j] = Buf[i] & 0x7f;
j++; j++;
} }
Temp[j] = '\0'; Temp[j] = '\0';