summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-22 00:09:03 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-22 00:09:03 +0000
commit96e1769b33a746ef30222444fe21752c3a0c3089 (patch)
tree6dc41ed6fd316e789f69a161a9aa24bf5d8cb349 /src
parent0471d95aa86b1e19e6346a0dd058fb8a5243d049 (diff)
Patch for IAL abort sequence from nenolod
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9168 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_sasl.cpp20
1 files changed, 14 insertions, 6 deletions
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*)&params, 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;
- }
}
}
};