From 1b19fe8b5ed80bd5053cb1767fc5e6a402705fed Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Thu, 31 Mar 2011 23:26:26 +0200 Subject: [PATCH] Revert "sasl: remove checks for impossible conditions". This check is not impossible and can be triggered by sending a PASS command like a server would send first. This backs out changeset 8cba4464feec. --- modules/m_sasl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/m_sasl.c b/modules/m_sasl.c index a4c5e24d..3345b212 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -81,6 +81,12 @@ mr_authenticate(struct Client *client_p, struct Client *source_p, if(!IsCapable(source_p, CLICAP_SASL)) return 0; + if (strlen(client_p->id) == 3) + { + exit_client(client_p, client_p, client_p, "Mixing client and server protocol"); + return 0; + } + if(source_p->preClient->sasl_complete) { sendto_one(source_p, form_str(ERR_SASLALREADY), me.name, EmptyString(source_p->name) ? "*" : source_p->name); @@ -117,7 +123,6 @@ mr_authenticate(struct Client *client_p, struct Client *source_p, else sendto_one(agent_p, ":%s ENCAP %s SASL %s %s C %s", me.id, agent_p->servptr->name, source_p->id, agent_p->id, parv[1]); - source_p->preClient->sasl_out++; return 0;