Apply sudo only to targetcli bin, not entire command
This commit is contained in:
parent
a0d664abfa
commit
f626a93f57
|
|
@ -476,19 +476,19 @@ delete ${iscsiName}
|
||||||
|
|
||||||
let command = "sh";
|
let command = "sh";
|
||||||
let args = ["-c"];
|
let args = ["-c"];
|
||||||
let taregetCliCommand = [];
|
|
||||||
taregetCliCommand.push(`echo "${data}"`.trim());
|
|
||||||
taregetCliCommand.push("|");
|
|
||||||
taregetCliCommand.push("targetcli");
|
|
||||||
|
|
||||||
|
let targetCliArgs = ["targetcli"];
|
||||||
if (
|
if (
|
||||||
_.get(this.options, "iscsi.shareStrategyTargetCli.sudoEnabled", false)
|
_.get(this.options, "iscsi.shareStrategyTargetCli.sudoEnabled", false)
|
||||||
) {
|
) {
|
||||||
command = "sudo";
|
targetCliArgs.unshift("sudo");
|
||||||
args.unshift("sh");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push("'" + taregetCliCommand.join(" ") + "'");
|
let targetCliCommand = [];
|
||||||
|
targetCliCommand.push(`echo "${data}"`.trim());
|
||||||
|
targetCliCommand.push("|");
|
||||||
|
targetCliCommand.push(targetCliArgs.join(" "));
|
||||||
|
args.push("'" + targetCliCommand.join(" ") + "'");
|
||||||
|
|
||||||
let logCommandTmp = command + " " + args.join(" ");
|
let logCommandTmp = command + " " + args.join(" ");
|
||||||
let logCommand = "";
|
let logCommand = "";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue