pidgin: 63223dd2: jabber: Make that more future-proof by n...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Jun 12 16:20:46 EDT 2010


-----------------------------------------------------------------
Revision: 63223dd28d39ec1b2e6b4f834003f60f33583385
Ancestor: 0673f8579282f4181ac7fb5738a1afc873b57cac
Author: darkrain42 at pidgin.im
Date: 2010-06-12T20:18:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/63223dd28d39ec1b2e6b4f834003f60f33583385

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

ChangeLog: 

jabber: Make that more future-proof by never generating "GSSAPI "

Changed at Masca's pestering.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/auth_cyrus.c	0133869a6af054953573bb36fcb09742d79083ac
+++ libpurple/protocols/jabber/auth_cyrus.c	3f23cf2f2b7f4616ebedaf633dcdda0dadc91efb
@@ -256,7 +256,7 @@ jabber_auth_start_cyrus(JabberStream *js
 					js->auth_fail_count++;
 
 				if (js->auth_fail_count == 1 &&
-					(js->sasl_mechs->str && g_str_equal(js->sasl_mechs->str, "GSSAPI "))) {
+					(js->sasl_mechs->str && g_str_equal(js->sasl_mechs->str, "GSSAPI"))) {
 					/* If we tried GSSAPI first, it failed, and it was the only method we had to try, try jabber:iq:auth
 					 * for compatibility with iChat 10.5 Server and other jabberd based servers.
 					 *
@@ -419,6 +419,10 @@ jabber_cyrus_start(JabberStream *js, xml
 		g_free(mech_name);
 	}
 
+	/* Strip off the trailing ' ' */
+	if (js->sasl_mechs->len > 1)
+		g_string_truncate(js->sasl_mechs, js->sasl_mechs->len - 1);
+
 	jabber_sasl_build_callbacks(js);
 	ret = jabber_auth_start_cyrus(js, reply, error);
 


More information about the Commits mailing list