diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_alias.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_banexception.cpp | 6 | ||||
-rw-r--r-- | src/modules/m_check.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_conn_umodes.cpp | 3 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index e0e4e6477..1eb78023e 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -157,7 +157,7 @@ class ModuleAlias : public Module /* Does it match the pattern? */ if (!Aliases[i].format.empty()) { - if (!match(Aliases[i].case_sensitive, compare.c_str(), Aliases[i].format.c_str())) + if (!match(Aliases[i].case_sensitive, compare, Aliases[i].format)) continue; } diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index e606346c3..bfb64449f 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -78,7 +78,7 @@ public: for (modelist::iterator it = list->begin(); it != list->end(); it++) { - if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true))) + if (match(user->GetFullRealHost(), it->mask) || match(user->GetFullHost(), it->mask) || (match(mask, it->mask, true))) { // They match an entry on the list, so let them in. return 1; @@ -118,10 +118,10 @@ public: if (list) { char mask[MAXBUF]; - snprintf(mask, MAXBUF, "%s!%s@%s", LM->user->nick, LM->user->ident, LM->user->GetIPString()); + std::string mask = std::string(LM->user->nick) + "!" + LM->user->ident + "@" + LM->user->GetIPString(); for (modelist::iterator it = list->begin(); it != list->end(); it++) { - if (match(LM->user->GetFullRealHost(), it->mask.c_str()) || match(LM->user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true))) + if (match(LM->user->GetFullRealHost(), it->mask) || match(LM->user->GetFullHost(), it->mask) || (match(mask, it->mask, true))) { // They match an entry return (char*)it->mask.c_str(); diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 775198213..258660a92 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -131,13 +131,13 @@ class CommandCheck : public Command /* hostname or other */ for (user_hash::const_iterator a = ServerInstance->Users->clientlist->begin(); a != ServerInstance->Users->clientlist->end(); a++) { - if (match(a->second->host, parameters[0].c_str()) || match(a->second->dhost, parameters[0].c_str())) + if (match(a->second->host, parameters[0]) || match(a->second->dhost, parameters[0])) { /* host or vhost matches mask */ user->WriteServ(checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost()); } /* IP address */ - else if (match(a->second->GetIPString(), parameters[0].c_str(), true)) + else if (match(a->second->GetIPString(), parameters[0], true)) { /* same IP. */ user->WriteServ(checkstr + " match " + ConvToStr(++x) + " " + a->second->GetFullRealHost()); diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp index 97a8b8340..ab017b157 100644 --- a/src/modules/m_conn_umodes.cpp +++ b/src/modules/m_conn_umodes.cpp @@ -57,7 +57,8 @@ class ModuleModesOnConnect : public Module for (int j = 0; j < Conf->Enumerate("connect"); j++) { std::string hostn = Conf->ReadValue("connect","allow",j); - if ((match(user->GetIPString(),hostn.c_str(),true)) || (match(user->host,hostn.c_str()))) + /* XXX: Fixme: does not respect port, limit, etc */ + if ((match(user->GetIPString(),hostn,true)) || (match(user->host,hostn))) { std::string ThisModes = Conf->ReadValue("connect","modes",j); if (!ThisModes.empty()) |