From 2fb0598a0ea172bc24e2686c5c1656e5054d5a5f Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 12 Dec 2011 16:40:22 +0000 Subject: [PATCH] ban evasion: fixed whitelist logic --- PBot/AntiFlood.pm | 20 ++++++++++---------- PBot/VERSION.pm | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 9ea14c6b..7ce6281c 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -475,18 +475,18 @@ sub check_nickserv_accounts { my $baninfo = $self->{pbot}->bantracker->get_baninfo($mask); - if($self->ban_whitelisted($baninfo->{channel}, $baninfo->{banmask})) { - $self->{pbot}->logger->log("anti-flood: [check-bans] $mask evaded $baninfo->{banmask} in $baninfo->{channel}, but allowed through whitelist\n"); - next; - } - if(defined $baninfo) { - $self->{pbot}->logger->log("anti-flood: [check-bans] $mask evaded $baninfo->{banmask} banned in $baninfo->{channel} by $baninfo->{owner}\n"); - push @banned_channels, $baninfo->{channel}; - $self->{pbot}->conn->privmsg($nick, "You have been banned in $baninfo->{channel} for attempting to evade a ban on $baninfo->{banmask} set by $baninfo->{owner}"); + if($self->ban_whitelisted($baninfo->{channel}, $baninfo->{banmask})) { + $self->{pbot}->logger->log("anti-flood: [check-bans] $mask evaded $baninfo->{banmask} in $baninfo->{channel}, but allowed through whitelist\n"); + next; + } else { + $self->{pbot}->logger->log("anti-flood: [check-bans] $mask evaded $baninfo->{banmask} banned in $baninfo->{channel} by $baninfo->{owner}\n"); + push @banned_channels, $baninfo->{channel}; + $self->{pbot}->conn->privmsg($nick, "You have been banned in $baninfo->{channel} for attempting to evade a ban on $baninfo->{banmask} set by $baninfo->{owner}"); + } } - } - } + } +} else { # no nickserv account set yet if($mask =~ m/^\Q$nick\E!/i) { diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 14fcca82..fb51b572 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 334, - BUILD_DATE => "2011-12-11", + BUILD_REVISION => 335, + BUILD_DATE => "2011-12-12", }; 1;