Hi all,

unfortunately the IMAP Kerberos (GSSAPI) is completely broken, unless your user 
name is “test” – for some strange reason, I forgot to fix a test version which 
(surprise) uses user test on a test vm with Samba4 & Kerberos.  Probably the 
right moment for me to grab a HUGE brown bag and hide in it… 😭

The trivial patch which emits the signal for reading the user name (no password 
is required in this case) is attached.

Sorry,
Albrecht.
diff --git a/libbalsa/imap/auth-gssapi.c b/libbalsa/imap/auth-gssapi.c
index 1c382d502..14a2de569 100644
--- a/libbalsa/imap/auth-gssapi.c
+++ b/libbalsa/imap/auth-gssapi.c
@@ -115,6 +115,7 @@ imap_gss_auth_loop(ImapMboxHandle* handle, NetClientGssCtx *gss_ctx, unsigned cm
 ImapResult
 imap_auth_gssapi(ImapMboxHandle* handle)
 {
+	gchar **auth_data;
     NetClientGssCtx *gss_ctx;
     GError *error = NULL;
     ImapResult retval;
@@ -123,8 +124,15 @@ imap_auth_gssapi(ImapMboxHandle* handle)
         return IMAP_AUTH_UNAVAIL;
     }
 
+    g_signal_emit_by_name(handle->sio, "auth", FALSE, &auth_data);
+    if((auth_data == NULL) || (auth_data[0] == NULL)) {
+    	imap_mbox_handle_set_msg(handle, "User name required, authentication cancelled");
+    	g_strfreev(auth_data);
+    	return IMAP_AUTH_CANCELLED;
+    }
+
     /* try to create the context */
-    gss_ctx = net_client_gss_ctx_new("imap", handle->host, "test", &error);
+    gss_ctx = net_client_gss_ctx_new("imap", handle->host, auth_data[0], &error);
     if (gss_ctx == NULL) {
     	retval = IMAP_AUTH_UNAVAIL;
     } else {
@@ -145,6 +153,7 @@ imap_auth_gssapi(ImapMboxHandle* handle)
 		net_client_gss_ctx_free(gss_ctx);
 		retval = (result && (rc == IMR_OK)) ? IMAP_SUCCESS : IMAP_AUTH_UNAVAIL;
     }
+	g_strfreev(auth_data);
 
     if (error != NULL) {
         gchar *err_msg;

Attachment: pgp3r0M1F0lcg.pgp
Description: PGP signature

_______________________________________________
balsa-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/balsa-list

Reply via email to