[virt-tools-list] [PATCH virt-viewer v2] session-spice: Pass hostname to authentication dialog
Eduardo Lima (Etrunko)
etrunko at redhat.com
Thu Feb 9 19:29:29 UTC 2017
On 09/02/17 17:22, Pavel Grunt wrote:
> On Thu, 2017-02-09 at 15:32 -0200, Eduardo Lima (Etrunko) wrote:
>> With this patch the dialog now shows the host we are connecting to.
>>
>> Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
> Acked-by: Pavel Grunt <pgrunt at redhat.com>
Thanks, pushed.
>> ---
>> 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_require
>> d ? &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");
--
Eduardo de Barros Lima (Etrunko)
Software Engineer - RedHat
etrunko at redhat.com
More information about the virt-tools-list
mailing list