Args weren't being passed to htpasswd command, fixes #2692

This commit is contained in:
Jamie Curnow 2023-03-17 08:49:18 +10:00
parent 44bebf366a
commit b30fcb50c8
No known key found for this signature in database
GPG Key ID: FFBB624C43388E9E

View File

@ -1,5 +1,6 @@
const exec = require('child_process').exec;
const execFile = require('child_process').execFile;
const logger = require('../logger').global;
module.exports = {
@ -20,12 +21,14 @@ module.exports = {
},
/**
* @param {Array} cmd
* @param {String} cmd
* @param {Array} args
* @returns {Promise}
*/
execFile: function (cmd) {
execFile: function (cmd, args) {
logger.debug('CMD: ' + cmd + ' ' + (args ? args.join(' ') : ''));
return new Promise((resolve, reject) => {
execFile(cmd, function (err, stdout, /*stderr*/) {
execFile(cmd, args, function (err, stdout, /*stderr*/) {
if (err && typeof err === 'object') {
reject(err);
} else {