summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-22 01:59:01 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-03-22 01:59:01 +0000
commitf14fe0c726e63def4129379abc793117f26ee0d2 (patch)
tree707b7f5fd69b777e13af25b4fe8283265c68132b /src
parent0ab6b96ca770654ece519fd67031dc13714d1d16 (diff)
Add abort fix
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9172 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_sasl.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp
index 89e8a379e..c9586bf97 100644
--- a/src/modules/m_sasl.cpp
+++ b/src/modules/m_sasl.cpp
@@ -96,6 +96,12 @@ class SaslAuthenticator
return this->state;
}
+ void Abort(void)
+ {
+ this->state = SASL_DONE;
+ this->result = SASL_ABORT;
+ }
+
bool SendClientMessage(const char* const* parameters, int pcnt)
{
if (this->state != SASL_COMM)
@@ -116,9 +122,7 @@ class SaslAuthenticator
if (*parameters[0] == '*')
{
- this->state = SASL_DONE;
- this->result = SASL_ABORT;
-
+ this->Abort();
return false;
}
@@ -203,10 +207,12 @@ class ModuleSASL : public Module
virtual int OnUserRegister(User *user)
{
- if (user->GetExt("sasl"))
+ SaslAuthenticator *sasl_;
+ if (user->GetExt("sasl_authenticator", sasl_))
{
- user->WriteServ("906 %s :SASL authentication aborted", user->nick);
- user->Shrink("sasl");
+ sasl_->Abort();
+ delete sasl_;
+ user->Shrink("sasl_authenticator");
}
return 0;
@@ -266,7 +272,7 @@ class ModuleSASL : public Module
if (state == SASL_DONE)
{
delete sasl_;
- user->Shrink("sasl");
+ target->Shrink("sasl");
}
}
}