]> xenbits.xensource.com Git - libvirt.git/commitdiff
esx: Change the default username when connecting to VCenter
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 24 Mar 2023 11:03:28 +0000 (12:03 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 24 Mar 2023 13:44:54 +0000 (14:44 +0100)
While it's true that the default username is:

  administrator@${SSO-Domain}

in majority of cases the ${SSO-Domain} is "vsphere.local". But
our code (and what virsh displays then) says it's just
"administrator".

This is wrong also from a different POV: the username must
contain the suffix no matter what and our default suggests
otherwise.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2181234
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/esx/esx_driver.c

index 9dc5489411044f9c1e054369646a2e18a28177a3..2443e6e88aa0067233e2a32c503efb242c927c29 100644 (file)
@@ -701,7 +701,8 @@ esxConnectToVCenter(esxPrivate *priv,
     if (conn->uri->user) {
         username = g_strdup(conn->uri->user);
     } else {
-        if (!(username = virAuthGetUsername(conn, auth, "esx", "administrator",
+        if (!(username = virAuthGetUsername(conn, auth, "esx",
+                                            "administrator@vsphere.local",
                                             hostname)))
             return -1;
     }