Skip to content
Snippets Groups Projects
Commit e565de71 authored by rswindell's avatar rswindell
Browse files

Temporary message files are now stored in the node's temp directory (for security reasons).

parent 6358984a
No related branches found
No related tags found
No related merge requests found
......@@ -257,7 +257,7 @@ void sbbs_t::quotemsg(smbmsg_t* msg, int tails)
{
char str[256];
sprintf(str,"%sQUOTES.TXT",cfg.node_dir);
sprintf(str,"%sQUOTES.TXT",cfg.temp_dir);
remove(str);
msgtotxt(msg,str,0,tails);
}
......
......@@ -84,14 +84,14 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
/* Quote entire message to MSGTMP or INPUT.MSG */
if(useron.xedit && cfg.xedit[useron.xedit-1]->misc&QUOTEALL) {
sprintf(str,"%sQUOTES.TXT",cfg.node_dir);
sprintf(str,"%sQUOTES.TXT",cfg.temp_dir);
if((stream=fnopen(NULL,str,O_RDONLY))==NULL) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
LFREE(buf);
return(false);
}
sprintf(str,"%s%s",cfg.node_dir,msgtmp); /* file for quoted msg */
sprintf(str,"%s%s",cfg.temp_dir,msgtmp); /* file for quoted msg */
if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
LFREE(buf);
......@@ -117,13 +117,13 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
;
else if(yesno(text[QuoteMessageQ])) {
sprintf(str,"%sQUOTES.TXT",cfg.node_dir);
sprintf(str,"%sQUOTES.TXT",cfg.temp_dir);
if((stream=fnopen(&file,str,O_RDONLY))==NULL) {
errormsg(WHERE,ERR_OPEN,str,O_RDONLY);
LFREE(buf);
return(false); }
sprintf(str,"%s%s",cfg.node_dir,msgtmp); /* file for quoted msg */
sprintf(str,"%s%s",cfg.temp_dir,msgtmp); /* file for quoted msg */
if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
LFREE(buf);
......@@ -205,7 +205,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
fclose(stream);
close(file); } }
else {
sprintf(str,"%sQUOTES.TXT",cfg.node_dir);
sprintf(str,"%sQUOTES.TXT",cfg.temp_dir);
remove(str); }
if(!online || sys_status&SS_ABORT) {
......@@ -287,7 +287,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
if(cfg.xedit[useron.xedit-1]->misc&WWIVCOLOR)
ex_mode|=EX_WWIV; }
sprintf(str,"%s%s",cfg.node_dir,msgtmp); /* temporary file for input */
sprintf(str,"%s%s",cfg.temp_dir,msgtmp); /* temporary file for input */
if(!linesquoted && fexist(str))
remove(str);
if(linesquoted) {
......@@ -296,14 +296,14 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
if(online==ON_LOCAL) {
if(cfg.node_misc&NM_LCL_EDIT && cfg.node_editor[0])
external(cmdstr(cfg.node_editor,str,nulstr,NULL)
,0,cfg.node_dir);
,0,cfg.temp_dir);
else
external(cmdstr(cfg.xedit[useron.xedit-1]->lcmd,str,nulstr,NULL)
,ex_mode,cfg.node_dir); }
,ex_mode,cfg.temp_dir); }
else {
rioctl(IOCM|PAUSE|ABORT);
external(cmdstr(cfg.xedit[useron.xedit-1]->rcmd,str,nulstr,NULL),ex_mode,cfg.node_dir);
external(cmdstr(cfg.xedit[useron.xedit-1]->rcmd,str,nulstr,NULL),ex_mode,cfg.temp_dir);
rioctl(IOSM|PAUSE|ABORT); }
checkline();
if(!fexist(str) || !online
......@@ -330,7 +330,7 @@ bool sbbs_t::writemsg(char *fname, char *top, char *title, long mode, int subnum
else {
buf[0]=0;
if(linesquoted) {
sprintf(str,"%s%s",cfg.node_dir,msgtmp);
sprintf(str,"%s%s",cfg.temp_dir,msgtmp);
if((file=nopen(str,O_RDONLY))!=-1) {
length=filelength(file);
l=length>cfg.level_linespermsg[useron_level]*MAX_LINE_LEN
......@@ -408,7 +408,7 @@ void sbbs_t::editor_inf(int xeditnum,char *dest, char *title, long mode
xeditnum--;
if(cfg.xedit[xeditnum]->misc&QUICKBBS) {
sprintf(str,"%sMSGINF",cfg.node_dir);
sprintf(str,"%sMSGINF",cfg.temp_dir);
if((file=nopen(str,O_WRONLY|O_CREAT|O_TRUNC))==-1) {
errormsg(WHERE,ERR_OPEN,str,O_WRONLY|O_CREAT|O_TRUNC);
return; }
......@@ -750,10 +750,10 @@ void sbbs_t::editfile(char *str)
long length,maxlines,lines,l;
maxlines=cfg.level_linespermsg[useron.level];
sprintf(str2,"%sQUOTES.TXT",cfg.node_dir);
sprintf(str2,"%sQUOTES.TXT",cfg.temp_dir);
remove(str2);
if(cfg.node_editor[0] && online==ON_LOCAL) {
external(cmdstr(cfg.node_editor,str,nulstr,NULL),0,cfg.node_dir);
external(cmdstr(cfg.node_editor,str,nulstr,NULL),0,cfg.temp_dir);
return; }
if(useron.xedit) {
editor_inf(useron.xedit,nulstr,nulstr,0,INVALID_SUB);
......@@ -764,10 +764,10 @@ void sbbs_t::editfile(char *str)
if(cfg.xedit[useron.xedit-1]->misc&WWIVCOLOR)
mode|=EX_WWIV; }
if(online==ON_LOCAL)
external(cmdstr(cfg.xedit[useron.xedit-1]->lcmd,str,nulstr,NULL),mode,cfg.node_dir);
external(cmdstr(cfg.xedit[useron.xedit-1]->lcmd,str,nulstr,NULL),mode,cfg.temp_dir);
else {
rioctl(IOCM|PAUSE|ABORT);
external(cmdstr(cfg.xedit[useron.xedit-1]->rcmd,str,nulstr,NULL),mode,cfg.node_dir);
external(cmdstr(cfg.xedit[useron.xedit-1]->rcmd,str,nulstr,NULL),mode,cfg.temp_dir);
rioctl(IOSM|PAUSE|ABORT); }
return; }
if((buf=(char *)MALLOC(maxlines*MAX_LINE_LEN))==NULL) {
......@@ -1000,7 +1000,7 @@ void sbbs_t::editmsg(smbmsg_t *msg, uint subnum)
if(!msg->hdr.total_dfields)
return;
sprintf(str,"%sINPUT.MSG",cfg.node_dir);
sprintf(str,"%sINPUT.MSG",cfg.temp_dir);
remove(str);
msgtotxt(msg,str,0,1);
editfile(str);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment