[Spice-devel] [patch 2/2] virt-viewer: use username and passwork for spice sessions

Christophe Fergeau cfergeau at redhat.com
Wed Oct 23 14:55:41 CEST 2013


On Wed, Oct 23, 2013 at 01:04:48PM +0200, dietmar at proxmox.com wrote:
> Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
> 
> Index: new/src/virt-viewer-session-spice.c
> ===================================================================
> --- new.orig/src/virt-viewer-session-spice.c	2013-07-31 13:57:28.000000000 +0200
> +++ new/src/virt-viewer-session-spice.c	2013-10-23 12:10:56.000000000 +0200
> @@ -342,6 +342,11 @@
>          g_object_set(G_OBJECT(session), "password", val, NULL);
>          g_free(val);
>      }
> +    if (virt_viewer_file_is_set(file, "username")) {
> +        gchar *val = virt_viewer_file_get_username(file);
> +        g_object_set(G_OBJECT(session), "username", val, NULL);
> +        g_free(val);
> +    }
>  
>      if (virt_viewer_file_is_set(file, "tls-ciphers")) {
>          gchar *val = virt_viewer_file_get_tls_ciphers(file);
> @@ -468,6 +473,7 @@
>  {
>      VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(session);
>      gchar *password = NULL;
> +    gchar *username = NULL;
>  
>      g_return_if_fail(self != NULL);
>  
> @@ -491,12 +497,13 @@
>          int ret = virt_viewer_auth_collect_credentials(self->priv->main_window,
>                                                         "SPICE",
>                                                         NULL,
> -                                                       NULL, &password);
> +                                                       &username, &password);

This seems to be asking for a username both in the SASL case when it makes
sense, but also in the usual 'ticket' case (spice-server -spice
password=foo command line option). In the latter case, we should not be
asking for a username as it is meaningless.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20131023/01cb210e/attachment.pgp>


More information about the Spice-devel mailing list