Debug fixes

This commit is contained in:
Michiel Broek 2003-05-10 11:51:43 +00:00
parent dc79124b4e
commit 55dc3c68f7
6 changed files with 272 additions and 278 deletions

View File

@ -19,6 +19,8 @@ v0.37.3 09-Apr-2003.
Fixed recognition of tar.gz files. Fixed recognition of tar.gz files.
Added menu function display file. Added menu function display file.
Display ascii textfiles now uses the More Y/n/= prompt. Display ascii textfiles now uses the More Y/n/= prompt.
When a new message is saved in a local area, the mailout
semafore is not set anymore.
mbuser: mbuser:
Added nopper code during pack. Added nopper code during pack.

2
TODO
View File

@ -46,6 +46,8 @@ mbsebbs:
N: OLR: qwk, check netmail entered from reader, fido address missing? N: OLR: qwk, check netmail entered from reader, fido address missing?
N: Reimplememnt CHRS kludge.
newuser: newuser:
L: Allow handles to be the same as the unixname. L: Allow handles to be the same as the unixname.

View File

@ -72,11 +72,10 @@ void Good_Bye(int onsig)
* Update the users database record. * Update the users database record.
*/ */
sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT"));
if ((pUsrConfig = fopen(temp,"r+b")) != NULL) { if ((pUsrConfig = fopen(temp,"r+")) != NULL) {
sprintf(temp, "%s/%s/exitinfo", CFG.bbs_usersdir, exitinfo.Name); sprintf(temp, "%s/%s/exitinfo", CFG.bbs_usersdir, exitinfo.Name);
if ((pExitinfo = fopen(temp,"rb")) != NULL) { if ((pExitinfo = fopen(temp,"rb")) != NULL) {
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig); fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig);
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
fread(&exitinfo, sizeof(exitinfo), 1, pExitinfo); fread(&exitinfo, sizeof(exitinfo), 1, pExitinfo);
usrconfig = exitinfo; usrconfig = exitinfo;
@ -93,8 +92,9 @@ void Good_Bye(int onsig)
usrconfig.iLastMsgArea = iMsgAreaNumber; usrconfig.iLastMsgArea = iMsgAreaNumber;
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize); offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
Syslog('b', "hdrsize=%ld recsize=%ld grecno=%ld", usrconfighdr.hdrsize, usrconfighdr.recsize, grecno);
Syslog('b', "Good_Bye: write users.data at offset %ld", offset); Syslog('b', "Good_Bye: write users.data at offset %ld", offset);
if (fseek(pUsrConfig, offset, 0) != 0) { if (fseek(pUsrConfig, offset, SEEK_SET) != 0) {
WriteError("Can't move pointer in file %s", temp); WriteError("Can't move pointer in file %s", temp);
ExitClient(MBERR_GENERAL); ExitClient(MBERR_GENERAL);
} }

View File

@ -614,8 +614,7 @@ int Save_Msg(int IsReply, faddr *Dest)
if (!Open_Msgbase(msgs.Base, 'w')) if (!Open_Msgbase(msgs.Base, 'w'))
return FALSE; return FALSE;
Msg.Arrived = time(NULL) - (gmt_offset((time_t)0) * 60); Msg.Written = Msg.Arrived = time(NULL) - (gmt_offset((time_t)0) * 60);
Msg.Written = Msg.Arrived;
Msg.Local = TRUE; Msg.Local = TRUE;
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
@ -636,9 +635,8 @@ int Save_Msg(int IsReply, faddr *Dest)
/* /*
* Add message text * Add message text
*/ */
for (i = 1; i <= Line; i++) { for (i = 1; i <= Line; i++)
MsgText_Add2(Message[i]); MsgText_Add2(Message[i]);
}
Add_Footkludges(TRUE, NULL, FALSE); Add_Footkludges(TRUE, NULL, FALSE);
@ -652,7 +650,6 @@ int Save_Msg(int IsReply, faddr *Dest)
exitinfo.iPosted++; exitinfo.iPosted++;
WriteExitinfo(); WriteExitinfo();
do_mailout = TRUE;
LC_Wrote = TRUE; LC_Wrote = TRUE;
Syslog('+', "Msg (%ld) to \"%s\", \"%s\", in %ld", Msg.Id, Msg.To, Msg.Subject, iMsgAreaNumber + 1); Syslog('+', "Msg (%ld) to \"%s\", \"%s\", in %ld", Msg.Id, Msg.To, Msg.Subject, iMsgAreaNumber + 1);
@ -681,8 +678,8 @@ int Save_Msg(int IsReply, faddr *Dest)
* Add quick mailscan info * Add quick mailscan info
*/ */
if (msgs.Type != LOCALMAIL) { if (msgs.Type != LOCALMAIL) {
sprintf(temp, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), do_mailout = TRUE;
((msgs.Type == ECHOMAIL) || (msgs.Type == LIST))? "echo" : "net"); sprintf(temp, "%s/tmp/%smail.jam", getenv("MBSE_ROOT"), ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST))? "echo" : "net");
if ((fp = fopen(temp, "a")) != NULL) { if ((fp = fopen(temp, "a")) != NULL) {
fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id); fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id);
fclose(fp); fclose(fp);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Utilities for message handling. * Purpose ...............: Utilities for message handling.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2003
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -91,12 +91,11 @@ char *rfcdate(time_t now)
offset *= 60; offset *= 60;
offset += gtm.tm_min - ptm.tm_min; offset += gtm.tm_min - ptm.tm_min;
if (offset <= 0) if (offset <= 0) {
{
sign='+'; sign='+';
offset=-offset; offset=-offset;
} } else
else sign='-'; sign='-';
hr=offset/60L; hr=offset/60L;
min=offset%60L; min=offset%60L;
@ -164,20 +163,17 @@ void Add_Headkludges(faddr *dest, int IsReply)
case NETMAIL: Msg.Netmail = TRUE; case NETMAIL: Msg.Netmail = TRUE;
sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka)); sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka));
sprintf(Msg.ToAddress, "%s", ascfnode(dest, 0x1f)); sprintf(Msg.ToAddress, "%s", ascfnode(dest, 0x1f));
if (msgs.Aka.point) { if (msgs.Aka.point) {
sprintf(temp, "\001FMPT %d", msgs.Aka.point); sprintf(temp, "\001FMPT %d", msgs.Aka.point);
MsgText_Add2(temp); MsgText_Add2(temp);
} }
if (dest->point) { if (dest->point) {
sprintf(temp, "\001TOPT %d", dest->point); sprintf(temp, "\001TOPT %d", dest->point);
MsgText_Add2(temp); MsgText_Add2(temp);
} }
sprintf(temp, "\001INTL %d:%d/%d %d:%d/%d", dest->zone, dest->net,
sprintf(temp, "\001INTL %d:%d/%d %d:%d/%d", dest->zone, dest->net, dest->node, msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node); dest->node, msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node);
MsgText_Add2(temp); MsgText_Add2(temp);
break; break;
case LIST: Msg.Echomail = TRUE; case LIST: Msg.Echomail = TRUE;
@ -247,8 +243,7 @@ void Add_Headkludges(faddr *dest, int IsReply)
*/ */
void Add_Footkludges(int Quote, char *tear, int HasTear) void Add_Footkludges(int Quote, char *tear, int HasTear)
{ {
char *temp; char *temp, *aka;
char *aka;
FILE *fp; FILE *fp;
temp = calloc(PATH_MAX, sizeof(char)); temp = calloc(PATH_MAX, sizeof(char));
@ -260,7 +255,6 @@ void Add_Footkludges(int Quote, char *tear, int HasTear)
if (Quote) { if (Quote) {
sprintf(temp, "%s/%s/.signature", CFG.bbs_usersdir, exitinfo.Name); sprintf(temp, "%s/%s/.signature", CFG.bbs_usersdir, exitinfo.Name);
if ((fp = fopen(temp, "r"))) { if ((fp = fopen(temp, "r"))) {
Syslog('m', " Add .signature");
MsgText_Add2((char *)""); MsgText_Add2((char *)"");
while (fgets(temp, 80, fp)) { while (fgets(temp, 80, fp)) {
Striplf(temp); Striplf(temp);
@ -272,7 +266,6 @@ void Add_Footkludges(int Quote, char *tear, int HasTear)
} }
if (msgs.Quotes && Quote) { if (msgs.Quotes && Quote) {
Syslog('m', " Add quote");
sprintf(temp, "... %s", Oneliner_Get()); sprintf(temp, "... %s", Oneliner_Get());
MsgText_Add2(temp); MsgText_Add2(temp);
MsgText_Add2((char *)""); MsgText_Add2((char *)"");
@ -291,7 +284,6 @@ void Add_Footkludges(int Quote, char *tear, int HasTear)
} }
if ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST)) { if ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST)) {
/* RANDOM ORIGIN LINES IMPLEMENTEREN */
if (msgs.Aka.point) if (msgs.Aka.point)
sprintf(aka, "(%d:%d/%d.%d)", msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node, msgs.Aka.point); sprintf(aka, "(%d:%d/%d.%d)", msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node, msgs.Aka.point);
else else

View File

@ -6,7 +6,7 @@
* does a lot of checking in general. * does a lot of checking in general.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2002 * Copyright (C) 1997-2003
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -185,7 +185,7 @@ void user()
Syslog('+', "Unixmode login: %s", sUnixName); Syslog('+', "Unixmode login: %s", sUnixName);
sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT")); sprintf(temp, "%s/etc/users.data", getenv("MBSE_ROOT"));
if ((pUsrConfig = fopen(temp,"r+b")) == NULL) { if ((pUsrConfig = fopen(temp,"r+")) == NULL) {
/* /*
* This should not happen. * This should not happen.
*/ */
@ -204,6 +204,7 @@ void user()
} }
if (!FoundName) { if (!FoundName) {
fclose(pUsrConfig);
printf("Unknown username: %s\n", sUnixName); printf("Unknown username: %s\n", sUnixName);
/* FATAL ERROR: You are not in the BBS users file.*/ /* FATAL ERROR: You are not in the BBS users file.*/
printf("%s\n", (char *) Language(389)); printf("%s\n", (char *) Language(389));
@ -407,8 +408,8 @@ void user()
WriteError("Can't seek in %s/etc/users.data", getenv("MBSE_ROOT")); WriteError("Can't seek in %s/etc/users.data", getenv("MBSE_ROOT"));
} else { } else {
fwrite(&usrconfig, sizeof(usrconfig), 1, pUsrConfig); fwrite(&usrconfig, sizeof(usrconfig), 1, pUsrConfig);
fclose(pUsrConfig);
} }
fclose(pUsrConfig);
/* /*
* Write users structure to tmp file in ~/home/unixname/exitinfo * Write users structure to tmp file in ~/home/unixname/exitinfo
@ -422,9 +423,9 @@ void user()
ChangeHomeDir(exitinfo.Name, exitinfo.Email); ChangeHomeDir(exitinfo.Name, exitinfo.Email);
Syslog('+', "User successfully logged into BBS"); Syslog('+', "User successfully logged into BBS");
Syslog('+', "Level %d (%s), %d mins. left, port %s", usrconfig.Security.level, LIMIT.Description, usrconfig.iTimeLeft, pTTY); Syslog('+', "Level %d (%s), %d mins. left, port %s", exitinfo.Security.level, LIMIT.Description, exitinfo.iTimeLeft, pTTY);
Time2Go = time(NULL); Time2Go = time(NULL);
Time2Go += usrconfig.iTimeLeft * 60; Time2Go += exitinfo.iTimeLeft * 60;
iUserTimeLeft = exitinfo.iTimeLeft; iUserTimeLeft = exitinfo.iTimeLeft;
IsDoing("Welcome screens"); IsDoing("Welcome screens");