X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_sasl.cpp;h=a9f2f205c8c0438643c0aaf8b66a82d1e3d45030;hb=a23a840749db9646884907ae28588b1962dc2449;hp=259c3bd162002c4c8f6b302b2359633f03c611eb;hpb=59ca4eec57a9c8b37e79e3031c74b59d4803fc28;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index 259c3bd16..a9f2f205c 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -101,7 +101,7 @@ class SaslAuthenticator : public classbase this->result = SASL_ABORT; } - bool SendClientMessage(const char* const* parameters, int pcnt) + bool SendClientMessage(const std::vector& parameters) { if (this->state != SASL_COMM) return true; @@ -113,12 +113,11 @@ class SaslAuthenticator : public classbase params.push_back(this->agent); params.push_back("C"); - for (int i = 0; i < pcnt; ++i) - params.push_back(parameters[i]); + params.insert(params.end(), parameters.begin(), parameters.end()); ServerInstance->PI->SendEncapsulatedData(params); - if (*parameters[0] == '*') + if (parameters[0][0] == '*') { this->Abort(); return false; @@ -135,13 +134,13 @@ class SaslAuthenticator : public classbase switch (this->result) { case SASL_OK: - this->user->WriteNumeric(903, "%s :SASL authentication successful", this->user->nick); + this->user->WriteNumeric(903, "%s :SASL authentication successful", this->user->nick.c_str()); break; case SASL_ABORT: - this->user->WriteNumeric(906, "%s :SASL authentication aborted", this->user->nick); + this->user->WriteNumeric(906, "%s :SASL authentication aborted", this->user->nick.c_str()); break; case SASL_FAIL: - this->user->WriteNumeric(904, "%s :SASL authentication failed", this->user->nick); + this->user->WriteNumeric(904, "%s :SASL authentication failed", this->user->nick.c_str()); break; default: break; @@ -166,7 +165,7 @@ class CommandAuthenticate : public Command this->source = "m_sasl.so"; } - CmdResult Handle (const char* const* parameters, int pcnt, User *user) + CmdResult Handle (const std::vector& parameters, User *user) { /* Only allow AUTHENTICATE on unregistered clients */ if (user->registered != REG_ALL) @@ -177,7 +176,7 @@ class CommandAuthenticate : public Command SaslAuthenticator *sasl; if (!(user->GetExt("sasl_authenticator", sasl))) sasl = new SaslAuthenticator(user, parameters[0], ServerInstance, Creator); - else if (sasl->SendClientMessage(parameters, pcnt) == false) // IAL abort extension --nenolod + else if (sasl->SendClientMessage(parameters) == false) // IAL abort extension --nenolod delete sasl; } return CMD_FAILURE; @@ -189,7 +188,7 @@ class ModuleSASL : public Module { CommandAuthenticate* sasl; public: - + ModuleSASL(InspIRCd* Me) : Module(Me) { @@ -251,7 +250,7 @@ class ModuleSASL : public Module virtual Version GetVersion() { - return Version(1,2,0,1,VF_VENDOR,API_VERSION); + return Version("$Id$",VF_VENDOR,API_VERSION); } virtual void OnEvent(Event *ev)