diff options
Diffstat (limited to 'src/esx/esx_driver.c')
-rw-r--r-- | src/esx/esx_driver.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c index 00d0e0a6f0..031c666f62 100644 --- a/src/esx/esx_driver.c +++ b/src/esx/esx_driver.c @@ -617,7 +617,6 @@ esxConnectToHost(esxPrivate *priv, int result = -1; char ipAddress[NI_MAXHOST] = ""; char *username = NULL; - char *unescapedPassword = NULL; char *password = NULL; char *url = NULL; esxVI_String *propertyNameList = NULL; @@ -647,18 +646,13 @@ esxConnectToHost(esxPrivate *priv, } } - unescapedPassword = virAuthGetPassword(conn, auth, "esx", username, conn->uri->server); + password = virAuthGetPassword(conn, auth, "esx", username, conn->uri->server); - if (!unescapedPassword) { + if (!password) { virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed")); goto cleanup; } - password = esxUtil_EscapeForXml(unescapedPassword); - - if (!password) - goto cleanup; - if (virAsprintf(&url, "%s://%s:%d/sdk", priv->parsedUri->transport, conn->uri->server, conn->uri->port) < 0) goto cleanup; @@ -705,7 +699,6 @@ esxConnectToHost(esxPrivate *priv, cleanup: VIR_FREE(username); - VIR_FREE(unescapedPassword); VIR_FREE(password); VIR_FREE(url); esxVI_String_Free(&propertyNameList); @@ -726,7 +719,6 @@ esxConnectToVCenter(esxPrivate *priv, int result = -1; char ipAddress[NI_MAXHOST] = ""; char *username = NULL; - char *unescapedPassword = NULL; char *password = NULL; char *url = NULL; @@ -752,18 +744,13 @@ esxConnectToVCenter(esxPrivate *priv, } } - unescapedPassword = virAuthGetPassword(conn, auth, "esx", username, hostname); + password = virAuthGetPassword(conn, auth, "esx", username, hostname); - if (!unescapedPassword) { + if (!password) { virReportError(VIR_ERR_AUTH_FAILED, "%s", _("Password request failed")); goto cleanup; } - password = esxUtil_EscapeForXml(unescapedPassword); - - if (!password) - goto cleanup; - if (virAsprintf(&url, "%s://%s:%d/sdk", priv->parsedUri->transport, hostname, conn->uri->port) < 0) goto cleanup; @@ -799,7 +786,6 @@ esxConnectToVCenter(esxPrivate *priv, cleanup: VIR_FREE(username); - VIR_FREE(unescapedPassword); VIR_FREE(password); VIR_FREE(url); |