[Spice-devel] [spice-gtk PATCH v3 2/2] authentication: Handle failed spice authentication

Snir Sheriber ssheribe at redhat.com
Sun Feb 26 10:09:18 UTC 2017


Changing the name of the failures handling function (spice
and sasl authentication failures are now treated separately)
and display more suitable spice authentication failure error
message.

Resolves: rhbz#1365736
---
 src/spice-channel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/spice-channel.c b/src/spice-channel.c
index 2b00c8f..aa09c12 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -1139,8 +1139,8 @@ static void spice_channel_failed_sasl_authentication(SpiceChannel *channel)
 #endif
 
 /* coroutine context */
-static void spice_channel_failed_authentication(SpiceChannel *channel,
-                                                gboolean invalidPassword)
+static void spice_channel_failed_spice_authentication(SpiceChannel *channel,
+                                                      gboolean invalidPassword)
 {
     SpiceChannelPrivate *c = channel->priv;
 
@@ -1153,7 +1153,7 @@ static void spice_channel_failed_authentication(SpiceChannel *channel,
         g_set_error_literal(&c->error,
                             SPICE_CLIENT_ERROR,
                             SPICE_CLIENT_ERROR_AUTH_NEEDS_PASSWORD,
-                            _("Authentication failed: password is required"));
+                            _("Authentication failed: wrong password ?"));
 
     c->event = SPICE_CHANNEL_ERROR_AUTH;
 
@@ -1192,7 +1192,7 @@ static SpiceChannelEvent spice_channel_send_spice_ticket(SpiceChannel *channel)
     if (password == NULL)
         password = g_strdup("");
     if (strlen(password) > SPICE_MAX_PASSWORD_LENGTH) {
-        spice_channel_failed_authentication(channel, TRUE);
+        spice_channel_failed_spice_authentication(channel, TRUE);
         ret = SPICE_CHANNEL_ERROR_AUTH;
         goto cleanup;
     }
@@ -1228,7 +1228,7 @@ static gboolean spice_channel_recv_auth(SpiceChannel *channel)
 
     if (link_res != SPICE_LINK_ERR_OK) {
         CHANNEL_DEBUG(channel, "link result: reply %u", link_res);
-        spice_channel_failed_authentication(channel, FALSE);
+        spice_channel_failed_spice_authentication(channel, FALSE);
         return FALSE;
     }
 
-- 
2.9.3



More information about the Spice-devel mailing list