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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@xxxxxxxxxx>
---
 src/virt-viewer-session-spice.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index c3fce48..bbdc680 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -667,7 +667,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
                                              VirtViewerSession *session)
 {
     VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
-    gchar *password = NULL, *user = NULL;
+    gchar *password = NULL, *user = NULL, *host = NULL;
     gboolean ret;
     static gboolean username_required = FALSE;
 
@@ -717,9 +717,10 @@ 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);
         if (!ret) {
@@ -749,8 +750,9 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
             SpiceURI *proxy = spice_session_get_proxy_uri(self->priv->session);
             g_warn_if_fail(proxy != NULL);
 
+            g_object_get(self->priv->session, "host", &host, NULL);
             ret = virt_viewer_auth_collect_credentials(self->priv->main_window,
-                                                       "proxy", NULL,
+                                                       "proxy", host,
                                                        &user, &password);
             if (!ret) {
                 g_signal_emit_by_name(session, "session-cancelled");
@@ -776,6 +778,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel,
 
     g_free(password);
     g_free(user);
+    g_free(host);
 }
 
 static void remove_cb(GtkContainer   *container G_GNUC_UNUSED,
-- 
2.9.3

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list



[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux