X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_cloaking.cpp;h=2bd8df80eea37f9dc6b3126e44c85cd0ba8e0b31;hb=de25d946733f774e3a5b53a58438a9c92af0acbe;hp=221c23d6421a20a6f5c67e687263a163babe7064;hpb=1524caf2f799cff54c2de330c9670a0b761ba3d8;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index 221c23d64..2bd8df80e 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -63,7 +63,7 @@ class CloakUser : public ModeHandler return host.substr(splitdot); } - CloakUser(InspIRCd* Instance, Module* source, Module* Hash) + CloakUser(Module* source, Module* Hash) : ModeHandler(source, 'x', PARAM_NONE, MODETYPE_USER), HashProvider(Hash), ext("cloaked_host", source) { @@ -197,7 +197,7 @@ class CloakUser : public ModeHandler void DoRehash() { - ConfigReader Conf(ServerInstance); + ConfigReader Conf; bool lowercase; /* These are *not* using the need_positive parameter of ReadInteger - @@ -256,15 +256,14 @@ class ModuleCloaking : public Module CloakUser* cu; public: - ModuleCloaking(InspIRCd* Me) - : Module(Me) + ModuleCloaking() { /* Attempt to locate the md5 service provider, bail if we can't find it */ Module* HashModule = ServerInstance->Modules->Find("m_md5.so"); if (!HashModule) throw ModuleException("Can't find m_md5.so. Please load m_md5.so before m_cloaking.so."); - cu = new CloakUser(ServerInstance, this, HashModule); + cu = new CloakUser(this, HashModule); try { @@ -305,19 +304,16 @@ class ModuleCloaking : public Module } } - ModResult OnCheckBan(User* user, Channel* chan) + ModResult OnCheckBan(User* user, Channel* chan, const std::string& mask) { - char mask[MAXBUF]; + char cmask[MAXBUF]; std::string* cloak = cu->ext.get(user); /* Check if they have a cloaked host, but are not using it */ if (cloak && *cloak != user->dhost) { - snprintf(mask, MAXBUF, "%s!%s@%s", user->nick.c_str(), user->ident.c_str(), cloak->c_str()); - for (BanList::iterator i = chan->bans.begin(); i != chan->bans.end(); i++) - { - if (InspIRCd::Match(mask,i->data)) - return MOD_RES_DENY; - } + snprintf(cmask, MAXBUF, "%s!%s@%s", user->nick.c_str(), user->ident.c_str(), cloak->c_str()); + if (InspIRCd::Match(cmask,mask)) + return MOD_RES_DENY; } return MOD_RES_PASSTHRU; } @@ -343,7 +339,7 @@ class ModuleCloaking : public Module { // returns the version number of the module to be // listed in /MODULES - return Version("$Id$", VF_COMMON|VF_VENDOR,API_VERSION); + return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR,API_VERSION); } void OnRehash(User* user)