From 2029dcf81532f6061b9f39ed34757273777be809 Mon Sep 17 00:00:00 2001 From: SKP Date: Wed, 10 Apr 2019 21:39:36 +0200 Subject: [PATCH] Fixed htpasswd. Now produces passwords for any string --- install/generator-cyphernode/generators/app/lib/htpasswd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/install/generator-cyphernode/generators/app/lib/htpasswd.js b/install/generator-cyphernode/generators/app/lib/htpasswd.js index 7531794..1a0f612 100644 --- a/install/generator-cyphernode/generators/app/lib/htpasswd.js +++ b/install/generator-cyphernode/generators/app/lib/htpasswd.js @@ -6,8 +6,10 @@ module.exports = async ( password ) => { return null; } + password = password.replace(/'/g, `'\\''`); + return await new Promise( (resolve) => { - exec('htpasswd -bnB admin '+password+' | cut -sd \':\' -f2', (error, stdout, stderr) => { + exec('htpasswd -bnB admin \''+password+'\' | cut -sd \':\' -f2', (error, stdout, stderr) => { if (error) { return resolve(null); }