summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");
}
}
}