cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yas...@apache.org
Subject git commit: updated refs/heads/master to 809b47e
Date Fri, 18 Jul 2014 01:43:13 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 2a01fd4c5 -> 809b47e4e


CLOUDSTACK-7124: Fix semicolon caused VPN programming issue

Semicolon can cause trouble in bash, need to be escaped.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/809b47e4
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/809b47e4
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/809b47e4

Branch: refs/heads/master
Commit: 809b47e4eb2a99248ad122499e288610a5cd12ad
Parents: 2a01fd4
Author: Sheng Yang <sheng.yang@citrix.com>
Authored: Thu Jul 17 18:40:14 2014 -0700
Committer: Sheng Yang <sheng.yang@citrix.com>
Committed: Thu Jul 17 18:40:14 2014 -0700

----------------------------------------------------------------------
 .../resource/virtualnetwork/ConfigHelper.java   | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/809b47e4/core/src/com/cloud/agent/resource/virtualnetwork/ConfigHelper.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/ConfigHelper.java b/core/src/com/cloud/agent/resource/virtualnetwork/ConfigHelper.java
index 25a2bd9..d94c1c6 100644
--- a/core/src/com/cloud/agent/resource/virtualnetwork/ConfigHelper.java
+++ b/core/src/com/cloud/agent/resource/virtualnetwork/ConfigHelper.java
@@ -19,15 +19,6 @@
 
 package com.cloud.agent.resource.virtualnetwork;
 
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.commons.codec.binary.Base64;
-
-import com.google.gson.Gson;
-
 import com.cloud.agent.api.BumpUpPriorityCommand;
 import com.cloud.agent.api.SetupGuestNetworkCommand;
 import com.cloud.agent.api.routing.CreateIpAliasCommand;
@@ -62,6 +53,13 @@ import com.cloud.network.HAProxyConfigurator;
 import com.cloud.network.LoadBalancerConfigurator;
 import com.cloud.network.rules.FirewallRule;
 import com.cloud.utils.net.NetUtils;
+import com.google.gson.Gson;
+import org.apache.commons.codec.binary.Base64;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
 
 public class ConfigHelper {
 
@@ -447,10 +445,11 @@ public class ConfigHelper {
             args += cmd.getPeerGatewayIp();
             args += " -N ";
             args += cmd.getPeerGuestCidrList();
+            // escape semicolon which may cause issue in bash
             args += " -e ";
-            args += "\"" + cmd.getEspPolicy() + "\"";
+            args += "\"" + cmd.getEspPolicy().replaceAll(";", "\\\\;") + "\"";
             args += " -i ";
-            args += "\"" + cmd.getIkePolicy() + "\"";
+            args += "\"" + cmd.getIkePolicy().replaceAll(";", "\\\\;") + "\"";
             args += " -t ";
             args += Long.toString(cmd.getIkeLifetime());
             args += " -T ";


Mime
View raw message