mirror of https://github.com/apache/cloudstack.git
kvm: xml escape password, use default charset
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
eea716b791
commit
13de2691fd
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue