[virt-tools-list] [PATCH virt-viewer v2] session-spice: Pass hostname to authentication dialog

Eduardo Lima (Etrunko) etrunko at redhat.com
Thu Feb 9 17:32:58 UTC 2017


With this patch the dialog now shows the host we are connecting to.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
---
v2: Use proper uri if connecting via proxy.
---
 src/virt-viewer-session-spice.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index c3fce48..9b52ec0 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -691,6 +691,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
     case SPICE_CHANNEL_ERROR_AUTH:
     {
         const GError *error = NULL;
+        gchar *host = NULL;
         g_debug("main channel: auth failure (wrong username/password?)");
 
         {
@@ -717,11 +718,13 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
                 user = g_strdup(g_get_user_name());
         }
 
+        g_object_get(self->priv->session, "host", &host, NULL);
         ret = virt_viewer_auth_collect_credentials(self->priv->main_window,
                                                    "SPICE",
-                                                   NULL,
+                                                   host,
                                                    username_required ? &user : NULL,
                                                    &password);
+        g_free(host);
         if (!ret) {
             g_signal_emit_by_name(session, "session-cancelled");
         } else {
@@ -750,7 +753,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
             g_warn_if_fail(proxy != NULL);
 
             ret = virt_viewer_auth_collect_credentials(self->priv->main_window,
-                                                       "proxy", NULL,
+                                                       "proxy", spice_uri_get_hostname(proxy),
                                                        &user, &password);
             if (!ret) {
                 g_signal_emit_by_name(session, "session-cancelled");
-- 
2.9.3




More information about the virt-tools-list mailing list