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

Snir Sheriber ssheribe at redhat.com
Mon Feb 13 13:49:45 UTC 2017


Changing the name of the function that now handles failures
in the spice authentication process separately from the sasl
authentication failures and display more suitable 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 37e36d9..0242845 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -1145,8 +1145,8 @@ static void spice_channel_failed_sasl_authentication(SpiceChannel *channel, int
 #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;
 
@@ -1159,7 +1159,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;
 
@@ -1198,7 +1198,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;
     }
@@ -1234,7 +1234,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