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.
Added menu function display file.
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:
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: Reimplememnt CHRS kludge.
newuser:
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.
*/
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);
if ((pExitinfo = fopen(temp,"rb")) != NULL) {
fread(&usrconfighdr, sizeof(usrconfighdr), 1, pUsrConfig);
offset = usrconfighdr.hdrsize + (grecno * usrconfighdr.recsize);
fread(&exitinfo, sizeof(exitinfo), 1, pExitinfo);
usrconfig = exitinfo;
@ -93,8 +92,9 @@ void Good_Bye(int onsig)
usrconfig.iLastMsgArea = iMsgAreaNumber;
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);
if (fseek(pUsrConfig, offset, 0) != 0) {
if (fseek(pUsrConfig, offset, SEEK_SET) != 0) {
WriteError("Can't move pointer in file %s", temp);
ExitClient(MBERR_GENERAL);
}

View File

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

View File

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

View File

@ -6,7 +6,7 @@
* does a lot of checking in general.
*
*****************************************************************************
* Copyright (C) 1997-2002
* Copyright (C) 1997-2003
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -185,7 +185,7 @@ void user()
Syslog('+', "Unixmode login: %s", sUnixName);
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.
*/
@ -204,6 +204,7 @@ void user()
}
if (!FoundName) {
fclose(pUsrConfig);
printf("Unknown username: %s\n", sUnixName);
/* FATAL ERROR: You are not in the BBS users file.*/
printf("%s\n", (char *) Language(389));
@ -407,8 +408,8 @@ void user()
WriteError("Can't seek in %s/etc/users.data", getenv("MBSE_ROOT"));
} else {
fwrite(&usrconfig, sizeof(usrconfig), 1, pUsrConfig);
fclose(pUsrConfig);
}
fclose(pUsrConfig);
/*
* Write users structure to tmp file in ~/home/unixname/exitinfo
@ -422,9 +423,9 @@ void user()
ChangeHomeDir(exitinfo.Name, exitinfo.Email);
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 += usrconfig.iTimeLeft * 60;
Time2Go += exitinfo.iTimeLeft * 60;
iUserTimeLeft = exitinfo.iTimeLeft;
IsDoing("Welcome screens");