Fix cloaking/invite exception for new extban checks

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11713 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
danieldg 2009-09-13 20:33:27 +00:00
parent 060e401cdb
commit 49a21413ee
2 changed files with 7 additions and 11 deletions

View File

@ -305,19 +305,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;
}

View File

@ -67,10 +67,9 @@ public:
std::string mask = std::string(user->nick) + "!" + user->ident + "@" + user->GetIPString();
for (modelist::iterator it = list->begin(); it != list->end(); it++)
{
if(InspIRCd::Match(user->GetFullRealHost(), it->mask) || InspIRCd::Match(user->GetFullHost(), it->mask) || (InspIRCd::MatchCIDR(mask, it->mask)))
if (chan->CheckBan(user, it->mask))
{
// They match an entry on the list, so let them in.
return MOD_RES_DENY;
return MOD_RES_ALLOW;
}
}
}