# HG changeset patch # User Paul Aurich # Date 1276373911 0 # Node ID e9d540664ea3dd0b3ccae72a3a2ee8ebf582f854 # Parent e727f4f0ae0206778e1a7f3a27b2082b14b69a19 jabber: Make that more future-proof by never generating "GSSAPI " Changed at Masca's pestering. diff -r e727f4f0ae02 -r e9d540664ea3 libpurple/protocols/jabber/auth_cyrus.c --- 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);