Skip to content
Snippets Groups Projects
Commit 84e114aa authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Move temp file cleanup from sbbs_t::logon() to sbbs_t::init()

It's possible for a sysop to allow message creation before logon (e.g. a login
matrix mode).

Eliminate the use of netmail.msg as a temporary message input file (not sure
why this has stuck around for so long).
parent cbf6a8b2
No related branches found
No related tags found
No related merge requests found
Pipeline #5495 passed
...@@ -197,9 +197,6 @@ bool sbbs_t::logon() ...@@ -197,9 +197,6 @@ bool sbbs_t::logon()
useron.logontime=(time32_t)logontime; useron.logontime=(time32_t)logontime;
last_ns_time=ns_time=useron.ns_time; last_ns_time=ns_time=useron.ns_time;
// ns_time-=(useron.tlast*60); /* file newscan time == last logon time */ // ns_time-=(useron.tlast*60); /* file newscan time == last logon time */
delfiles(cfg.temp_dir,ALLFILES);
safe_snprintf(str, sizeof(str), "%smsgs/n%3.3u.msg",cfg.data_dir,cfg.node_num);
remove(str); /* remove any pending node messages */
if(!SYSOP && online==ON_REMOTE && !(sys_status&SS_QWKLOGON)) { if(!SYSOP && online==ON_REMOTE && !(sys_status&SS_QWKLOGON)) {
rioctl(IOCM|ABORT); /* users can't abort anything */ rioctl(IOCM|ABORT); /* users can't abort anything */
......
...@@ -3564,6 +3564,16 @@ bool sbbs_t::init() ...@@ -3564,6 +3564,16 @@ bool sbbs_t::init()
thisnode.misc&=(NODE_EVENT|NODE_LOCK|NODE_RRUN); thisnode.misc&=(NODE_EVENT|NODE_LOCK|NODE_RRUN);
criterrs=thisnode.errors; criterrs=thisnode.errors;
putnodedat(cfg.node_num,&thisnode); putnodedat(cfg.node_num,&thisnode);
// remove any pending node messages
safe_snprintf(str, sizeof(str), "%smsgs/n%3.3u.msg",cfg.data_dir,cfg.node_num);
remove(str);
// Delete any stale temporary files (with potentially sensitive content)
delfiles(cfg.temp_dir,ALLFILES);
safe_snprintf(str, sizeof(str), "%sMSGTMP", cfg.node_dir);
removecase(str);
safe_snprintf(str, sizeof(str), "%sQUOTES.TXT", cfg.node_dir);
removecase(str);
} }
/* Reset COMMAND SHELL */ /* Reset COMMAND SHELL */
......
...@@ -1035,7 +1035,7 @@ bool sbbs_t::inetmail(const char *into, const char *subj, int mode, smb_t* resmb ...@@ -1035,7 +1035,7 @@ bool sbbs_t::inetmail(const char *into, const char *subj, int mode, smb_t* resmb
mode |= WM_QUOTE; mode |= WM_QUOTE;
} }
SAFEPRINTF(msgpath,"%snetmail.msg",cfg.node_dir); msg_tmp_fname(useron.xedit, msgpath, sizeof(msgpath));
if(!writemsg(msgpath,nulstr,title,WM_NETMAIL|mode,INVALID_SUB, to_list, /* from: */your_addr, &editor, &charset)) { if(!writemsg(msgpath,nulstr,title,WM_NETMAIL|mode,INVALID_SUB, to_list, /* from: */your_addr, &editor, &charset)) {
strListFree(&rcpt_list); strListFree(&rcpt_list);
bputs(text[Aborted]); bputs(text[Aborted]);
...@@ -1313,7 +1313,7 @@ bool sbbs_t::qnetmail(const char *into, const char *subj, int mode, smb_t* resmb ...@@ -1313,7 +1313,7 @@ bool sbbs_t::qnetmail(const char *into, const char *subj, int mode, smb_t* resmb
mode |= WM_QUOTE; mode |= WM_QUOTE;
} }
SAFEPRINTF(msgpath,"%snetmail.msg",cfg.node_dir); msg_tmp_fname(useron.xedit, msgpath, sizeof(msgpath));
if(!writemsg(msgpath,nulstr,title, (mode|WM_QWKNET|WM_NETMAIL) ,INVALID_SUB,to,/* from: */useron.alias, &editor, &charset)) { if(!writemsg(msgpath,nulstr,title, (mode|WM_QWKNET|WM_NETMAIL) ,INVALID_SUB,to,/* from: */useron.alias, &editor, &charset)) {
bputs(text[Aborted]); bputs(text[Aborted]);
return(false); return(false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment