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

@ -604,95 +604,92 @@ void Post_Msg()
*/ */
int Save_Msg(int IsReply, faddr *Dest) int Save_Msg(int IsReply, faddr *Dest)
{ {
int i; int i;
char *temp; char *temp;
FILE *fp; FILE *fp;
if (Line < 2) if (Line < 2)
return TRUE;
if (!Open_Msgbase(msgs.Base, 'w'))
return FALSE;
Msg.Arrived = time(NULL) - (gmt_offset((time_t)0) * 60);
Msg.Written = Msg.Arrived;
Msg.Local = TRUE;
temp = calloc(PATH_MAX, sizeof(char));
if (strlen(Msg.ReplyTo) && (msgs.Type == NETMAIL)) {
/*
* Send message to internet gateway.
*/
Syslog('m', "UUCP message to %s", Msg.ReplyAddr);
sprintf(Msg.To, "UUCP");
Add_Headkludges(Dest, IsReply);
sprintf(temp, "To: %s", Msg.ReplyAddr);
MsgText_Add2(temp);
MsgText_Add2((char *)"");
} else {
Add_Headkludges(Dest, IsReply);
}
/*
* Add message text
*/
for (i = 1; i <= Line; i++) {
MsgText_Add2(Message[i]);
}
Add_Footkludges(TRUE, NULL, FALSE);
/*
* Save if to disk
*/
Msg_AddMsg();
Msg_UnLock();
ReadExitinfo();
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);
colour(CFG.HiliteF, CFG.HiliteB);
/* Saving message to disk */
printf("\n%s(%ld)\n\n", (char *) Language(202), Msg.Id);
fflush(stdout);
sleep(2);
msgs.LastPosted = time(NULL);
msgs.Posted.total++;
msgs.Posted.tweek++;
msgs.Posted.tdow[Diw]++;
msgs.Posted.month[Miy]++;
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r+")) != NULL) {
fseek(fp, msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize)), SEEK_SET);
fwrite(&msgs, msgshdr.recsize, 1, fp);
fclose(fp);
}
/*
* 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");
if ((fp = fopen(temp, "a")) != NULL) {
fprintf(fp, "%s %lu\n", msgs.Base, Msg.Id);
fclose(fp);
}
}
free(temp);
Msg_Close();
SetMsgArea(iMsgAreaNumber);
return TRUE; return TRUE;
if (!Open_Msgbase(msgs.Base, 'w'))
return FALSE;
Msg.Written = Msg.Arrived = time(NULL) - (gmt_offset((time_t)0) * 60);
Msg.Local = TRUE;
temp = calloc(PATH_MAX, sizeof(char));
if (strlen(Msg.ReplyTo) && (msgs.Type == NETMAIL)) {
/*
* Send message to internet gateway.
*/
Syslog('m', "UUCP message to %s", Msg.ReplyAddr);
sprintf(Msg.To, "UUCP");
Add_Headkludges(Dest, IsReply);
sprintf(temp, "To: %s", Msg.ReplyAddr);
MsgText_Add2(temp);
MsgText_Add2((char *)"");
} else {
Add_Headkludges(Dest, IsReply);
}
/*
* Add message text
*/
for (i = 1; i <= Line; i++)
MsgText_Add2(Message[i]);
Add_Footkludges(TRUE, NULL, FALSE);
/*
* Save if to disk
*/
Msg_AddMsg();
Msg_UnLock();
ReadExitinfo();
exitinfo.iPosted++;
WriteExitinfo();
LC_Wrote = TRUE;
Syslog('+', "Msg (%ld) to \"%s\", \"%s\", in %ld", Msg.Id, Msg.To, Msg.Subject, iMsgAreaNumber + 1);
colour(CFG.HiliteF, CFG.HiliteB);
/* Saving message to disk */
printf("\n%s(%ld)\n\n", (char *) Language(202), Msg.Id);
fflush(stdout);
sleep(2);
msgs.LastPosted = time(NULL);
msgs.Posted.total++;
msgs.Posted.tweek++;
msgs.Posted.tdow[Diw]++;
msgs.Posted.month[Miy]++;
sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT"));
if ((fp = fopen(temp, "r+")) != NULL) {
fseek(fp, msgshdr.hdrsize + (iMsgAreaNumber * (msgshdr.recsize + msgshdr.syssize)), SEEK_SET);
fwrite(&msgs, msgshdr.recsize, 1, fp);
fclose(fp);
}
/*
* Add quick mailscan info
*/
if (msgs.Type != LOCALMAIL) {
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);
}
}
free(temp);
Msg_Close();
SetMsgArea(iMsgAreaNumber);
return TRUE;
} }

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
@ -58,53 +58,52 @@ static char *months[]={(char *)"Jan",(char *)"Feb",(char *)"Mar",
char *rfcdate(time_t now) char *rfcdate(time_t now)
{ {
static char buf[40]; static char buf[40];
struct tm ptm, gtm; struct tm ptm, gtm;
char sign; char sign;
int hr, min; int hr, min;
long offset; long offset;
if (!now) if (!now)
now = time(NULL); now = time(NULL);
ptm = *localtime(&now); ptm = *localtime(&now);
/* /*
* To get the timezone, compare localtime with GMT. * To get the timezone, compare localtime with GMT.
*/ */
gtm = *gmtime(&now); gtm = *gmtime(&now);
/* /*
* Assume we are never more than 24 hours away. * Assume we are never more than 24 hours away.
*/ */
offset = gtm.tm_yday - ptm.tm_yday; offset = gtm.tm_yday - ptm.tm_yday;
if (offset > 1) if (offset > 1)
offset = -24; offset = -24;
else if (offset < -1) else if (offset < -1)
offset = 24; offset = 24;
else else
offset *= 24; offset *= 24;
/* /*
* Scale in the hours and minutes; ignore seconds. * Scale in the hours and minutes; ignore seconds.
*/ */
offset += gtm.tm_hour - ptm.tm_hour; offset += gtm.tm_hour - ptm.tm_hour;
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
} sign='-';
else sign='-'; hr=offset/60L;
hr=offset/60L; min=offset%60L;
min=offset%60L;
sprintf(buf,"%s, %02d %s %04d %02d:%02d:%02d %c%02d%02d", sprintf(buf,"%s, %02d %s %04d %02d:%02d:%02d %c%02d%02d",
wdays[gtm.tm_wday],gtm.tm_mday,months[gtm.tm_mon], wdays[gtm.tm_wday],gtm.tm_mday,months[gtm.tm_mon],
gtm.tm_year+1900,gtm.tm_hour,gtm.tm_min,gtm.tm_sec, gtm.tm_year+1900,gtm.tm_hour,gtm.tm_min,gtm.tm_sec,
sign,hr,min); sign,hr,min);
return(buf); return(buf);
} }
@ -114,21 +113,21 @@ char *rfcdate(time_t now)
*/ */
int Open_Msgbase(char *Base, int Mode) int Open_Msgbase(char *Base, int Mode)
{ {
BaseWrite = FALSE; BaseWrite = FALSE;
if (!Msg_Open(Base)) if (!Msg_Open(Base))
return FALSE; return FALSE;
if (Mode != 'w') if (Mode != 'w')
return TRUE;
if (!Msg_Lock(30L)) {
Msg_Close();
return FALSE;
}
BaseWrite = TRUE;
return TRUE; return TRUE;
if (!Msg_Lock(30L)) {
Msg_Close();
return FALSE;
}
BaseWrite = TRUE;
return TRUE;
} }
@ -138,104 +137,101 @@ int Open_Msgbase(char *Base, int Mode)
*/ */
void Close_Msgbase() void Close_Msgbase()
{ {
if (BaseWrite) { if (BaseWrite) {
Msg_UnLock(); Msg_UnLock();
BaseWrite = FALSE; BaseWrite = FALSE;
} }
Msg_Close(); Msg_Close();
} }
void Add_Headkludges(faddr *dest, int IsReply) void Add_Headkludges(faddr *dest, int IsReply)
{ {
char *temp, *temp2; char *temp, *temp2;
unsigned long crc = -1; unsigned long crc = -1;
time_t tt; time_t tt;
int i; int i;
faddr *Node; faddr *Node;
temp = calloc(128, sizeof(char)); temp = calloc(128, sizeof(char));
switch (msgs.Type) { switch (msgs.Type) {
case LOCALMAIL: Msg.Localmail = TRUE; case LOCALMAIL: Msg.Localmail = TRUE;
break; break;
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) {
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);
MsgText_Add2(temp);
break;
if (msgs.Aka.point) { case LIST: Msg.Echomail = TRUE;
sprintf(temp, "\001FMPT %d", msgs.Aka.point); sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka));
MsgText_Add2(temp); break;
}
if (dest->point) { case ECHOMAIL: Msg.Echomail = TRUE;
sprintf(temp, "\001TOPT %d", dest->point); sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka));
MsgText_Add2(temp); break;
}
sprintf(temp, "\001INTL %d:%d/%d %d:%d/%d", dest->zone, dest->net, dest->node, msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node); case NEWS: /*
MsgText_Add2(temp); * Header style is the same as GoldED does.
*/
Msg.News = TRUE;
sprintf(temp, "\001Date: %s", rfcdate(Msg.Written));
MsgText_Add2(temp);
Node = fido2faddr(msgs.Aka);
temp2 = xstrcpy(Msg.From);
for (i = 0; i < strlen(temp2); i++)
if (temp2[i] == ' ')
temp2[i] = '_';
sprintf(temp, "\001From: %s@%s (%s)", temp2, ascinode(Node, 0x2f), Msg.From);
MsgText_Add2(temp);
sprintf(temp, "\001Subject: %s", Msg.Subject);
MsgText_Add2(temp);
sprintf(temp, "\001Sender: %s@%s (%s)", temp2, ascinode(Node, 0x2f), Msg.From);
MsgText_Add2(temp);
free(temp2);
tidy_faddr(Node);
MsgText_Add2((char *)"\001To: All");
MsgText_Add2((char *)"\001MIME-Version: 1.0");
MsgText_Add2((char *)"\001Content-Type: text/plain");
MsgText_Add2((char *)"\001Content-Transfer-Encoding: 8bit");
sprintf(temp, "\001X-Mailreader: MBSE BBS %s", VERSION);
MsgText_Add2(temp);
break;
}
break; // sprintf(temp, "\001CHRS: %s", getchrs(msgs.Ftncode));
// MsgText_Add2(temp);
sprintf(temp, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer());
MsgText_Add2(temp);
Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp));
case LIST: Msg.Echomail = TRUE; if (IsReply) {
sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka)); sprintf(temp, "\001REPLY: %s", Msg.Replyid);
break;
case ECHOMAIL: Msg.Echomail = TRUE;
sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka));
break;
case NEWS: /*
* Header style is the same as GoldED does.
*/
Msg.News = TRUE;
sprintf(temp, "\001Date: %s", rfcdate(Msg.Written));
MsgText_Add2(temp);
Node = fido2faddr(msgs.Aka);
temp2 = xstrcpy(Msg.From);
for (i = 0; i < strlen(temp2); i++)
if (temp2[i] == ' ')
temp2[i] = '_';
sprintf(temp, "\001From: %s@%s (%s)", temp2, ascinode(Node, 0x2f), Msg.From);
MsgText_Add2(temp);
sprintf(temp, "\001Subject: %s", Msg.Subject);
MsgText_Add2(temp);
sprintf(temp, "\001Sender: %s@%s (%s)", temp2, ascinode(Node, 0x2f), Msg.From);
MsgText_Add2(temp);
free(temp2);
tidy_faddr(Node);
MsgText_Add2((char *)"\001To: All");
MsgText_Add2((char *)"\001MIME-Version: 1.0");
MsgText_Add2((char *)"\001Content-Type: text/plain");
MsgText_Add2((char *)"\001Content-Transfer-Encoding: 8bit");
sprintf(temp, "\001X-Mailreader: MBSE BBS %s", VERSION);
MsgText_Add2(temp);
break;
}
// sprintf(temp, "\001CHRS: %s", getchrs(msgs.Ftncode));
// MsgText_Add2(temp);
sprintf(temp, "\001MSGID: %s %08lx", aka2str(msgs.Aka), sequencer());
MsgText_Add2(temp); MsgText_Add2(temp);
Msg.MsgIdCRC = upd_crc32(temp, crc, strlen(temp)); crc = -1;
Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp));
} else
Msg.ReplyCRC = 0xffffffff;
if (IsReply) { sprintf(temp, "\001PID: MBSE-BBS %s", VERSION);
sprintf(temp, "\001REPLY: %s", Msg.Replyid); MsgText_Add2(temp);
MsgText_Add2(temp); tt = time(NULL);
crc = -1; sprintf(temp, "\001TZUTC: %s", gmtoffset(tt));
Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp)); MsgText_Add2(temp);
} else free(temp);
Msg.ReplyCRC = 0xffffffff;
sprintf(temp, "\001PID: MBSE-BBS %s", VERSION);
MsgText_Add2(temp);
tt = time(NULL);
sprintf(temp, "\001TZUTC: %s", gmtoffset(tt));
MsgText_Add2(temp);
free(temp);
} }
@ -247,65 +243,61 @@ 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));
aka = calloc(32, sizeof(char)); aka = calloc(32, sizeof(char));
/* /*
* If Quote (message entered at the bbs) we append a signature. * If Quote (message entered at the bbs) we append a signature.
*/ */
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); MsgText_Add2(temp);
MsgText_Add2(temp);
}
fclose(fp);
MsgText_Add2((char *)"");
} }
fclose(fp);
MsgText_Add2((char *)"");
} }
}
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 *)""); }
/*
* The offline reader may override the tearline
*/
if (!HasTear) {
if (tear == NULL) {
MsgText_Add2(TearLine());
} else {
sprintf(temp, "--- %s", tear);
MsgText_Add2(temp);
} }
}
/* if ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST)) {
* The offline reader may override the tearline if (msgs.Aka.point)
*/ sprintf(aka, "(%d:%d/%d.%d)", msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node, msgs.Aka.point);
if (!HasTear) { else
if (tear == NULL) { sprintf(aka, "(%d:%d/%d)", msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node);
MsgText_Add2(TearLine());
} else {
sprintf(temp, "--- %s", tear);
MsgText_Add2(temp);
}
}
if ((msgs.Type == ECHOMAIL) || (msgs.Type == LIST)) { if (strlen(msgs.Origin))
/* RANDOM ORIGIN LINES IMPLEMENTEREN */ sprintf(temp, " * Origin: %s %s", msgs.Origin, aka);
if (msgs.Aka.point) else
sprintf(aka, "(%d:%d/%d.%d)", msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node, msgs.Aka.point); sprintf(temp, " * Origin: %s %s", CFG.origin, aka);
else MsgText_Add2(temp);
sprintf(aka, "(%d:%d/%d)", msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node); }
if (strlen(msgs.Origin)) free(aka);
sprintf(temp, " * Origin: %s %s", msgs.Origin, aka); free(temp);
else
sprintf(temp, " * Origin: %s %s", CFG.origin, aka);
MsgText_Add2(temp);
}
free(aka);
free(temp);
} }

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");