From 3ab4a5e36d18c2868de0ec3a1ad113d42ecd4e1a Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 17 Jan 2013 11:50:12 +0100 Subject: [PATCH] Fix for an Issue #345 --- lib/core/option.py | 2 +- lib/request/redirecthandler.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index a498c7ab1..4d12b49ec 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1555,7 +1555,7 @@ def _setKnowledgeBaseAttributes(flushAll=True): kb.lastParserStatus = None kb.locks = AttribDict() - for _ in ("cache", "count", "index", "io", "limit", "log", "request", "value"): + for _ in ("cache", "count", "index", "io", "limit", "log", "redirect", "request", "value"): kb.locks[_] = threading.Lock() kb.matchRatio = None diff --git a/lib/request/redirecthandler.py b/lib/request/redirecthandler.py index 8988e6588..b8e96d2d4 100644 --- a/lib/request/redirecthandler.py +++ b/lib/request/redirecthandler.py @@ -38,12 +38,13 @@ class SmartRedirectHandler(urllib2.HTTPRedirectHandler): return retVal def _ask_redirect_choice(self, redcode, redurl): - if kb.redirectChoice is None: - msg = "sqlmap got a %d redirect to " % redcode - msg += "'%s'. Do you want to follow? [Y/n] " % redurl - choice = readInput(msg, default="Y") + with kb.locks.redirect: + if kb.redirectChoice is None: + msg = "sqlmap got a %d redirect to " % redcode + msg += "'%s'. Do you want to follow? [Y/n] " % redurl + choice = readInput(msg, default="Y") - kb.redirectChoice = choice.upper() + kb.redirectChoice = choice.upper() def http_error_302(self, req, fp, code, msg, headers): content = None