From 018bcd26f800c1f5981df2a522e0bdfcd5768295 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Fri, 25 Jul 2014 16:17:30 -0700 Subject: [PATCH] CLOUDSTACK-7124: Fix semicolon caused VPN programming issue on Xen (cherry picked from commit abc0b40acb5d1b5b87362b4737605249525455dc) --- .../cloud/hypervisor/xen/resource/CitrixResourceBase.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 545067514cb..c1c97955f1d 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -566,9 +566,12 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe @Override public ExecutionResult executeInVR(String routerIP, String script, String args, int timeout) { Pair result; + String cmdline = "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args; + // semicolon need to be escape for bash + cmdline = cmdline.replaceAll(";", "\\\\;"); try { - s_logger.debug("Executing command in VR: /opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args); - result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), "/opt/cloud/bin/router_proxy.sh " + script + " " + routerIP + " " + args, + s_logger.debug("Executing command in VR: " + cmdline); + result = SshHelper.sshExecute(_host.ip, 22, _username, null, _password.peek(), cmdline, 60000, 60000, timeout * 1000); } catch (Exception e) { return new ExecutionResult(false, e.getMessage());