*/
#include "inspircd.h"
-#include "commands/cmd_whois.h"
-#include "commands/cmd_stats.h"
-#include "socket.h"
-#include "xline.h"
-#include "transport.h"
-#include "m_hash.h"
-#include "socketengine.h"
#include "m_spanningtree/main.h"
#include "m_spanningtree/utils.h"
this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Unknown server "+source+")");
return true;
}
-
/* Check parameters for validity before introducing the client, discovered by dmb */
- if (!age_t)
+ else if (!age_t)
{
this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid TS?)");
return true;
}
+ else if (!signon)
+ {
+ this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Invalid signon?)");
+ return true;
+ }
+ else if (params[8][0] != '+')
+ {
+ this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Invalid client introduction (Malformed MODE sequence?)");
+ return true;
+ }
/* check for collision */
user_hash::iterator iter = this->ServerInstance->Users->clientlist->find(params[2]);
{
if (mh->GetNumParams(true))
{
+ /* IMPORTANT NOTE:
+ * All modes are assumed to succeed here as they are being set by a remote server.
+ * Modes CANNOT FAIL here. If they DO fail, then the failure is ignored. This is important
+ * to note as all but one modules currently cannot ever fail in this situation, except for
+ * m_servprotect which specifically works this way to prevent the mode being set ANYWHERE
+ * but here, at client introduction. You may safely assume this behaviour is standard and
+ * will not change in future versions if you want to make use of this protective behaviour
+ * yourself.
+ */
if (paramptr < params.size() - 1)
mh->OnModeChange(_new, _new, NULL, params[paramptr++], true);
else
- ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, expected a parameter for user mode '%c' but there aren't enough parameters in the command!", *v);
+ {
+ this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Broken UID command, expected a parameter for user mode '"+(*v)+"' but there aren't enough parameters in the command!");
+ this->ServerInstance->Users->clientlist->erase(params[0]);
+ delete _new;
+ return true;
+ }
}
else
mh->OnModeChange(_new, _new, NULL, empty, true);
mh->ChangeCount(1);
}
else
- ServerInstance->Logs->Log("m_spanningtree", DEBUG, "Warning: Broken UID command, unknown user mode '%c' in the mode string!", *v);
+ {
+ this->WriteLine(std::string(":")+this->ServerInstance->Config->GetSID()+" KILL "+params[0]+" :Warning: Broken UID command, unknown user mode '"+(*v)+"' in the mode string!");
+ this->ServerInstance->Users->clientlist->erase(params[0]);
+ delete _new;
+ return true;
+ }
}
//_new->ProcessNoticeMasks(params[7].c_str());