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

Don't treat failure to read node[2+]/node.cnf as a fatal error

There was a period of time when *nix installs of sbbs (after the
migration to Git) didn't include node2/3/4 directories (and thus
the node.cnf files in those directories). In such an install, report
the error converting those node.cnf files to node.ini equivalents,
but don't stop the upgrade to v3.20. The terminal server will fallback
to the firs node config if any other node config (node.ini) file is
missing, so that's still okay (though not ideal).

This fixes issue #560

Thanks for the report Bobrob!
parent e61d3bb1
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -14,14 +14,12 @@ function upgrade_node(dir)
print(path + " -> node.ini");
var cnf = cnflib.read(path);
if(!cnf) {
alert("Error reading " + path);
exit(1);
return "Error reading " + path;
}
var ini = new File(dir + "node.ini");
ini.ini_section_separator = "";
if(!ini.open("w+")) {
alert("Error " + ini.error + " opening/creating " + ini.name);
exit(1);
return "Error " + ini.error + " opening/creating " + ini.name;
}
ini.iniSetObject(null, cnf);
ini.close();
......@@ -29,6 +27,7 @@ function upgrade_node(dir)
node_valuser = cnf.valuser;
node_erruser = cnf.erruser;
node_errlevel = cnf.errlevel;
return true;
}
//---------------------------------------------------------------------------
......@@ -101,10 +100,15 @@ for(var i in cnf) {
}
ini.iniSetObject("expired", exp);
for(var i in cnf.node_dir) {
for(var i = 0; i < cnf.node_dir.length; ++i) {
var path = backslash(cnf.node_dir[i].path.replace('\\','/'));
ini.iniSetValue("node_dir", parseInt(i, 10) + 1, path);
upgrade_node(path);
ini.iniSetValue("node_dir", i + 1, path);
var result = upgrade_node(path);
if(result !== true) {
alert(result);
if(i == 0)
exit(1);
}
}
delete cnf.node_dir;
cnf.login = 0;
......
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