Works around a race condition that sometimes triggers when running multiple AuthBrute modules concurrently.

git-svn-id: file:///home/svn/framework3/trunk@13078 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Tod Beardsley 2011-06-30 19:24:14 +00:00
parent 9e4b36d7ac
commit 238d256ecb
1 changed files with 4 additions and 0 deletions

View File

@ -136,6 +136,10 @@ module Auxiliary::AuthBrute
def counters_expired?(this_service,credentials)
expired_cred = false
expired_time = false
# Workaround for cases where multiple auth_brute modules are running concurrently and
# someone stomps on the @max_per_service class variable during setup.
current_max_per_service = self.class.class_variable_get("@@max_per_service") rescue nil
return false unless current_max_per_service
if @@guesses_per_service[this_service] >= (@@max_per_service)
if @@max_per_service < credentials.size
print_brute(