[virt-tools-list] [virt-viewer: PATCH 2/3 v2] Let the user set the username in the SPICE auth dialog

Christophe Fergeau cfergeau at redhat.com
Wed Sep 24 07:30:55 UTC 2014


On Tue, Sep 23, 2014 at 05:29:42PM -0500, Jonathon Jongsma wrote:
> On Tue, 2014-09-23 at 20:41 +0200, Fabiano Fidêncio wrote:
> > Currently virt-viewer doesn't allow the user to set his/her username
> > in the SPICE authentication dialog.
> > Now, auto fill the dialog with the current user name as username and
> > leave to the user the possibility to change it, if necessary.
> > ---
> > v2: Fix typo in the shortlog/commit message
> > ---
> >  src/virt-viewer-session-spice.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
> > index dd96fdf..6b61ce8 100644
> > --- a/src/virt-viewer-session-spice.c
> > +++ b/src/virt-viewer-session-spice.c
> > @@ -509,10 +509,11 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
> >                                    _("invalid password"));
> >          self->priv->pass_try++;
> >  
> > +        user = g_strdup (g_get_user_name());
> >          ret = virt_viewer_auth_collect_credentials(self->priv->main_window,
> >                                                     "SPICE",
> >                                                     NULL,
> > -                                                   NULL, &password);
> > +                                                   &user, &password);
> >          if (!ret) {
> >              g_signal_emit_by_name(session, "session-cancelled");
> >          } else {
> 
> 
> Hmm, I've never had the need to specify a username for Spice auth. When
> is that needed? Even if it was needed, it doesn't appear that the 'user'
> variable is actually used for anything in this patch. Am I missing
> something?

If SPICE is set up to use SASL for auth, some auth mechanism will need a
username (the plain text one and md5 ones for example). At the moment,
it's hardcoded to be g_get_user_name() in these situations. Last time
this was discussed, the proposed solution was for spice-gtk to indicate
that a username and a password is needed (ie have another error in
addition to SPICE_CHANNEL_ERROR_AUTH). See
http://lists.freedesktop.org/archives/spice-devel/2013-October/015181.html
A bit of background in this thread as well
http://lists.freedesktop.org/archives/spice-devel/2013-October/015075.html

Hope that helps,

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140924/420982d4/attachment.sig>


More information about the virt-tools-list mailing list