Fix for an Issue #345

This commit is contained in:
Miroslav Stampar 2013-01-17 11:50:12 +01:00
parent 51a77d1fe2
commit 3ab4a5e36d
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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