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

Check return value of getnodedat()

Should fix CID 515599 since this seems to be the only place we call
unlocknodedat() without possibly not owning the nodefile_mutex already.
parent b6062fa3
No related branches found
No related tags found
No related merge requests found
......@@ -109,7 +109,12 @@ bool sbbs_t::logon()
return(false);
}
getnodedat(cfg.node_num,&thisnode, true);
if(!getnodedat(cfg.node_num,&thisnode, true)) {
errormsg(WHERE, ERR_LOCK, "nodefile", cfg.node_num);
hangup();
return false;
}
if(thisnode.misc&NODE_LOCK) {
unlocknodedat(cfg.node_num); /* must unlock! */
if(!SYSOP && !(useron.exempt&FLAG('N'))) {
......@@ -120,13 +125,16 @@ bool sbbs_t::logon()
hangup();
return(false);
}
if(yesno(text[RemoveNodeLockQ])) {
getnodedat(cfg.node_num,&thisnode, true);
bool rmlock = yesno(text[RemoveNodeLockQ]);
if(!getnodedat(cfg.node_num,&thisnode, true)) {
errormsg(WHERE, ERR_LOCK, "nodefile", cfg.node_num);
hangup();
return false;
}
if(rmlock) {
logline("S-","Removed Node Lock");
thisnode.misc&=~NODE_LOCK;
thisnode.misc&=~NODE_LOCK;
}
else
getnodedat(cfg.node_num,&thisnode, true);
}
if(useron.exempt&FLAG('H'))
......
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