Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit bee6b15a authored by rswindell's avatar rswindell

In sbbs_t::getsmsg(), don't lock/read/write/unlock every single node

record in the node.dab - only the node(s) that have the requested user
number.
In sbbs_t::getsmsg() and ::getsmsg(), strip all invalid Ctrl-A attribute
codes (e.g. clear screen, pause, etc.) since short-messages (telegrams)
can come from external sources.
parent 584a24e0
......@@ -319,6 +319,8 @@ int sbbs_t::getsmsg(int usernumber)
int i;
for(i=1;i<=cfg.sys_nodes;i++) { /* clear msg waiting flag */
if(getnodedat(i,&node,false) != 0 || node.useron != usernumber)
continue;
if(getnodedat(i,&node,true)==0) {
if(node.useron==usernumber
&& (node.status==NODE_INUSE || node.status==NODE_QUIET)
......@@ -353,6 +355,7 @@ int sbbs_t::getsmsg(int usernumber)
getnodedat(cfg.node_num,&thisnode,0);
if(cols)
CRLF;
strip_invalid_attr(buf);
putmsg(buf,P_NOATCODES);
free(buf);
......@@ -372,7 +375,7 @@ int sbbs_t::whos_online(bool listself)
CRLF;
bputs(text[NodeLstHdr]);
for(j=0,i=1;i<=cfg.sys_nodes && i<=cfg.sys_lastnode;i++) {
getnodedat(i,&node,0);
getnodedat(i,&node,false);
if(i==cfg.node_num) {
if(listself)
printnodedat(i,&node);
......@@ -397,7 +400,7 @@ void sbbs_t::nodelist(void)
CRLF;
bputs(text[NodeLstHdr]);
for(int i=1;i<=cfg.sys_nodes && i<=cfg.sys_lastnode;i++) {
getnodedat(i,&node,0);
getnodedat(i,&node,false);
printnodedat(i,&node);
}
}
......
......@@ -1302,6 +1302,7 @@ char* DLLCALL getsmsg(scfg_t* cfg, int usernumber)
chsize(file,0L);
close(file);
buf[length]=0;
strip_invalid_attr(buf);
return(buf); /* caller must free */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment