Blob Blame History Raw
From e65dbb732d4f110dd6b55b510a754cffe0472b10 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy@redhat.com>
Date: Mon, 6 Jun 2016 18:04:59 +0200
Subject: [PATCH 16/17] sasl: fix SASL GSSAPI by allowing NULL username
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

SASL GSSAPI module will try to negotiate authentication based on the
credentials in the default credentials cache. It does not matter if
SPICE knows username or not as SASL negotiation will pass through the
discovered name from the GSSAPI module.

Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
Acked-by: Fabiano FidĂȘncio <fidencio@redhat.com>
(cherry picked from commit fb8e51667b9fa63497e413fb4fd484d23b772788)
---
 src/spice-channel.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/spice-channel.c b/src/spice-channel.c
index e52a6a9..fdc0e97 100644
--- a/src/spice-channel.c
+++ b/src/spice-channel.c
@@ -1389,11 +1389,10 @@ spice_channel_gather_sasl_credentials(SpiceChannel *channel,
         switch (interact[ninteract].id) {
         case SASL_CB_AUTHNAME:
         case SASL_CB_USER:
-            if (spice_session_get_username(c->session) == NULL)
-                return FALSE;
-
-            interact[ninteract].result =  spice_session_get_username(c->session);
-            interact[ninteract].len = strlen(interact[ninteract].result);
+            if (spice_session_get_username(c->session) != NULL) {
+                interact[ninteract].result =  spice_session_get_username(c->session);
+                interact[ninteract].len = strlen(interact[ninteract].result);
+            }
             break;
 
         case SASL_CB_PASS:
-- 
2.9.0