changeset 30178:e9d540664ea3

jabber: Make that more future-proof by never generating "GSSAPI " Changed at Masca's pestering.
author Paul Aurich <paul@darkrain42.org>
date Sat, 12 Jun 2010 20:18:31 +0000
parents e727f4f0ae02
children 40a8aae4b276
files libpurple/protocols/jabber/auth_cyrus.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/auth_cyrus.c	Sat Jun 12 18:22:46 2010 +0000
+++ b/libpurple/protocols/jabber/auth_cyrus.c	Sat Jun 12 20:18:31 2010 +0000
@@ -256,7 +256,7 @@
 					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 @@
 		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);