From 96e1769b33a746ef30222444fe21752c3a0c3089 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 22 Mar 2008 00:09:03 +0000 Subject: Patch for IAL abort sequence from nenolod git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9168 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_sasl.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 97bb6ff88..05206784c 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -97,7 +97,7 @@ class SaslAuthenticator return this->state; } - void SendClientMessage(const char* const* parameters, int pcnt) + bool SendClientMessage(const char* const* parameters, int pcnt) { if (this->state != SASL_COMM) return; @@ -114,6 +114,16 @@ class SaslAuthenticator Event e((char*)¶ms, Creator, "send_encap"); e.Send(ServerInstance); + + if (*parameters[0] == '*') + { + this->state = SASL_DONE; + this->result = SASL_ABORT; + + return false; + } + + return true; } void AnnounceState(void) @@ -139,6 +149,7 @@ class SaslAuthenticator ~SaslAuthenticator() { + this->user->Shrink("sasl_authenticator"); this->AnnounceState(); } }; @@ -163,8 +174,8 @@ class CommandAuthenticate : public Command SaslAuthenticator *sasl; if (!(user->GetExt("sasl_authenticator", sasl))) sasl = new SaslAuthenticator(user, parameters[0], ServerInstance, Creator); - else - sasl->SendClientMessage(parameters, pcnt); + else if (sasl->SendClientMessage(parameters, pcnt) == false) // IAL abort extension --nenolod + delete sasl; } return CMD_FAILURE; } @@ -252,10 +263,7 @@ class ModuleSASL : public Module SaslState state = sasl->ProcessInboundMessage(*parameters); if (state == SASL_DONE) - { - target->Shrink("sasl_authenticator"); delete sasl; - } } } }; -- cgit v1.2.3