Skip to content

Commit 018bcd2

Browse files
Sheng YangDaanHoogland
authored andcommitted
CLOUDSTACK-7124: Fix semicolon caused VPN programming issue on Xen
(cherry picked from commit abc0b40)
1 parent 8138984 commit 018bcd2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,12 @@ public Answer executeRequest(Command cmd) {
566566
@Override
567567
public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout) {
568568
Pair<Boolean, String> result;
569+
String cmdline = "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args;
570+
// semicolon need to be escape for bash
571+
cmdline = cmdline.replaceAll(";", "\\\\;");
569572
try {
570-
s_logger.debug("Executing command in VR: /opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args);
571-
result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args,
573+
s_logger.debug("Executing command in VR: " + cmdline);
574+
result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), cmdline,
572575
60000, 60000, timeout * 1000);
573576
} catch (Exception e) {
574577
return new ExecutionResult(false, e.getMessage());

0 commit comments

Comments
 (0)