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

Eduardo Lima (Etrunko) etrunko at redhat.com
Tue Feb 7 18:29:04 UTC 2017


On 06/02/17 09:20, Pavel Grunt wrote:
> On Fri, 2017-02-03 at 16:11 -0200, Eduardo Lima (Etrunko) wrote:
>> With this patch the dialog now shows the host we are trying to
>> connect to.
> 
> I would mention that we use the "host" property of SpiceSession 

Okay, will do.

> 
>>
>> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
> 
> ---
>>  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_require
>> d ? &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,
> 
> Should it be the "host" or the proxy uri (spice_uri_get_hostname()) ?
> 

I am really not sure, but I as it is a connection to the proxy, I think
it would make sense to use the proxy uri. Any suggestion?

-- 
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com




More information about the virt-tools-list mailing list