cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject git commit: updated refs/heads/4.5 to 13de269
Date Mon, 13 Apr 2015 10:39:49 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.5 eea716b79 -> 13de2691f


kvm: xml escape password, use default charset

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 13de2691fddb4b755605ee44ac0e95dedb26987d
Parents: eea716b
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Mon Apr 13 16:04:40 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Apr 13 16:04:40 2015 +0530

----------------------------------------------------------------------
 .../kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java  | 4 +++-
 .../com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java  | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/13de2691/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
index b5723ed..5c8d337 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtVMDef.java
@@ -16,6 +16,8 @@
 // under the License.
 package com.cloud.hypervisor.kvm.resource;
 
+import org.apache.commons.lang.StringEscapeUtils;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -1168,7 +1170,7 @@ public class LibvirtVMDef {
             _port = port;
             _autoPort = autoPort;
             _listenAddr = listenAddr;
-            _passwd = passwd;
+            _passwd = StringEscapeUtils.escapeXml(passwd);
             _keyMap = keyMap;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/13de2691/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
index 9da833e..5edc07b 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java
@@ -17,13 +17,13 @@
 package com.cloud.hypervisor.kvm.storage;
 
 import java.io.File;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import java.util.HashMap;
 
-
 import org.apache.commons.codec.binary.Base64;
 import org.apache.log4j.Logger;
 import org.libvirt.Connect;
@@ -394,7 +394,7 @@ public class LibvirtStorageAdaptor implements StorageAdaptor {
                 String authUsername = spd.getAuthUserName();
                 if (authUsername != null) {
                     Secret secret = conn.secretLookupByUUIDString(spd.getSecretUUID());
-                    String secretValue = new String(Base64.encodeBase64(secret.getByteValue()));
+                    String secretValue = new String(Base64.encodeBase64(secret.getByteValue()),
Charset.defaultCharset());
                     pool.setAuthUsername(authUsername);
                     pool.setAuthSecret(secretValue);
                 }


Mime
View raw message