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

Use main.ini instead of main.cnf for system password

Fixes issue #471
parent df38854e
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -6,7 +6,7 @@ require("acmev2.js", "ACMEv2"); ...@@ -6,7 +6,7 @@ require("acmev2.js", "ACMEv2");
var ks_fname = backslash(system.ctrl_dir)+"letsyncrypt.key"; var ks_fname = backslash(system.ctrl_dir)+"letsyncrypt.key";
var setting_fname = backslash(system.ctrl_dir)+"letsyncrypt.ini"; var setting_fname = backslash(system.ctrl_dir)+"letsyncrypt.ini";
var sks_fname = backslash(system.ctrl_dir)+"ssl.cert"; var sks_fname = backslash(system.ctrl_dir)+"ssl.cert";
var maincnf_fname = backslash(system.ctrl_dir)+"main.cnf"; var main_ini_fname = backslash(system.ctrl_dir)+"main.ini";
var recycle_sem = backslash(system.ctrl_dir)+"recycle"; var recycle_sem = backslash(system.ctrl_dir)+"recycle";
function at_least_a_third() function at_least_a_third()
...@@ -149,7 +149,7 @@ var i; ...@@ -149,7 +149,7 @@ var i;
var identifiers = []; var identifiers = [];
var ks; var ks;
var key_id; var key_id;
var maincnf = new File(maincnf_fname); var main_ini = new File(main_ini_fname);
var new_host = "acme-v02.api.letsencrypt.org"; var new_host = "acme-v02.api.letsencrypt.org";
var new_domain_hash = ''; var new_domain_hash = '';
var old_domain_hash; var old_domain_hash;
...@@ -239,12 +239,10 @@ if (renew || rekey || revoke || print_tos) { ...@@ -239,12 +239,10 @@ if (renew || rekey || revoke || print_tos) {
* *
* TODO: What happens when the system password changes? * TODO: What happens when the system password changes?
*/ */
if (!maincnf.open("rb", true)) if (!main_ini.open("r", true))
throw("Unable to open "+maincnf.name); throw("Unable to open "+main_ini.name);
maincnf.position = 186; // Indeed. syspass = main_ini.iniGetValue(null, "password");
syspass = maincnf.read(40); main_ini.close();
syspass = syspass.replace(/\x00/g,'');
maincnf.close();
/* /*
* Now open/create the keyset and RSA signing key for * Now open/create the keyset and RSA signing key for
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment