]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1393146 - Automate blocking IPs that bugzilla flags as exceeding rate limits
authorDylan William Hardison <dylan@hardison.net>
Thu, 21 Jun 2018 16:38:04 +0000 (12:38 -0400)
committerGitHub <noreply@github.com>
Thu, 21 Jun 2018 16:38:04 +0000 (12:38 -0400)
Bugzilla.pm

index 427dd3aeaf5047b67ded4e4606182a563e056c3d..ad8019a99ea03de2091c4baa1a40abe55fe587a5 100644 (file)
@@ -862,7 +862,10 @@ sub check_rate_limit {
             }
             my $limit = join("/", @$limit);
             Bugzilla->audit("[rate_limit] action=$action, ip=$ip, limit=$limit, name=$name");
-            ThrowUserError("rate_limit") if $action eq 'block';
+            if ($action eq 'block') {
+                Bugzilla::ModPerl::BlockIP->block_ip($ip);
+                ThrowUserError("rate_limit");
+            }
         }
     }
 }