Add abort fix

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9172 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
brain 2008-03-22 01:59:01 +00:00
parent 0ab6b96ca7
commit f14fe0c726

View File

@ -96,6 +96,12 @@ class SaslAuthenticator
return this->state; return this->state;
} }
void Abort(void)
{
this->state = SASL_DONE;
this->result = SASL_ABORT;
}
bool SendClientMessage(const char* const* parameters, int pcnt) bool SendClientMessage(const char* const* parameters, int pcnt)
{ {
if (this->state != SASL_COMM) if (this->state != SASL_COMM)
@ -116,9 +122,7 @@ class SaslAuthenticator
if (*parameters[0] == '*') if (*parameters[0] == '*')
{ {
this->state = SASL_DONE; this->Abort();
this->result = SASL_ABORT;
return false; return false;
} }
@ -203,10 +207,12 @@ class ModuleSASL : public Module
virtual int OnUserRegister(User *user) 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); sasl_->Abort();
user->Shrink("sasl"); delete sasl_;
user->Shrink("sasl_authenticator");
} }
return 0; return 0;
@ -266,7 +272,7 @@ class ModuleSASL : public Module
if (state == SASL_DONE) if (state == SASL_DONE)
{ {
delete sasl_; delete sasl_;
user->Shrink("sasl"); target->Shrink("sasl");
} }
} }
} }