1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 22:43:12 +02:00

Bug #1079 - Don't use users real host and IPs when matching against

bans and excepts, except when a user is unbanning themselves, in an
attempt to prevent people from gaining other users IPs.
This removes support for Unreal and Bahamuts SVSMode -b because
it will unban users by real host and IP.
This commit is contained in:
Adam
2010-12-13 16:36:36 -05:00
parent 97467cb2c8
commit 49d3c97b67
13 changed files with 36 additions and 50 deletions
+8 -12
View File
@@ -67,25 +67,21 @@ void kill_user(const Anope::string &source, User *user, const Anope::string &rea
* Unban the user from a channel
* @param ci channel info for the channel
* @param u The user to unban
* @param full True to match against the users real host and IP
* @return void
*/
void common_unban(ChannelInfo *ci, User *u)
void common_unban(ChannelInfo *ci, User *u, bool full)
{
if (!u || !ci || !ci->c || !ci->c->HasMode(CMODE_BAN))
return;
if (ircd->svsmode_unban)
ircdproto->SendBanDel(ci->c, u->nick);
else
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = ci->c->GetModeList(CMODE_BAN);
for (; bans.first != bans.second;)
{
std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> bans = ci->c->GetModeList(CMODE_BAN);
for (; bans.first != bans.second;)
{
Entry ban(bans.first->second);
++bans.first;
if (ban.Matches(u))
ci->c->RemoveMode(NULL, CMODE_BAN, ban.GetMask());
}
Entry ban(bans.first->second);
++bans.first;
if (ban.Matches(u, full))
ci->c->RemoveMode(NULL, CMODE_BAN, ban.GetMask());
}
}