adium.1-4: a554b059: Reapply the GSSAPI patch

darkrain42 at pidgin.im darkrain42 at pidgin.im
Thu Feb 18 12:10:22 EST 2010


-----------------------------------------------------------------
Revision: a554b059d556fb9fe7b3895dd6aca4ed2d53e421
Ancestor: ff3da8fd8e6ab001379876193c616508d8724025
Author: darkrain42 at pidgin.im
Date: 2010-02-18T17:08:40
Branch: im.pidgin.adium.1-4
URL: http://d.pidgin.im/viewmtn/revision/info/a554b059d556fb9fe7b3895dd6aca4ed2d53e421

Modified files:
        libpurple/protocols/jabber/auth_cyrus.c

ChangeLog: 

Reapply the GSSAPI patch

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth_cyrus.c	7961f08b1d98e8bbb353c802d343d771e568832a
+++ libpurple/protocols/jabber/auth_cyrus.c	9f25ac8e75700e56fc2bd1fd2df366f899700e14
@@ -525,6 +525,10 @@ jabber_cyrus_handle_failure(JabberStream
                             xmlnode **reply, char **error)
 {
 	if (js->auth_fail_count++ < 5) {
+		gboolean tried_gssapi_first = FALSE;
+
+		tried_gssapi_first = (js->auth_fail_count == 1 && g_str_equal(js->current_mech, "GSSAPI"));
+
 		if (js->current_mech && *js->current_mech) {
 			char *pos;
 			if ((pos = strstr(js->sasl_mechs->str, js->current_mech))) {
@@ -540,6 +544,15 @@ jabber_cyrus_handle_failure(JabberStream
 			sasl_dispose(&js->sasl);
 
 			return jabber_auth_start_cyrus(js, reply, error);
+		} else if (tried_gssapi_first) {
+			/* If we tried GSSAPI first, it failed, and it was our only shot, try jabber:iq:auth
+			 * for compatibility with iChat 10.5 Server.
+			 */
+			 sasl_dispose(&js->sasl);
+			 js->sasl = NULL;
+			 js->auth_mech = NULL;
+			 jabber_auth_start_old(js);
+			 return JABBER_SASL_STATE_CONTINUE;
 		}
 	}
 


More information about the Commits mailing list