minor improvements

This commit is contained in:
Bernardo Damele 2013-02-03 15:39:07 +00:00
parent 4c13e0e5a1
commit df3cc38cd9

View File

@ -169,14 +169,16 @@ def liveTest():
msg = "running live test case: %s (%d/%d)" % (name, count, length)
logger.info(msg)
try:
result = runCase(switches, parse)
except SqlmapNotVulnerableException:
vulnerable = False
initCase(switches)
test_case_fd = codecs.open(os.path.join(paths.SQLMAP_OUTPUT_PATH, "test_case"), "wb", UNICODE_ENCODING)
test_case_fd.write("%s\n" % name)
try:
result = runCase(parse)
except SqlmapNotVulnerableException:
vulnerable = False
if result is True:
logger.info("test passed")
cleanCase()
@ -250,13 +252,11 @@ def initCase(switches=None):
def cleanCase():
shutil.rmtree(paths.SQLMAP_OUTPUT_PATH, True)
def runCase(switches=None, parse=None):
def runCase(parse):
global failedItem
global failedParseOn
global failedTraceBack
initCase(switches)
LOGGER_HANDLER.stream = sys.stdout = tempfile.SpooledTemporaryFile(max_size=0, mode="w+b", prefix="sqlmapstdout-")
retVal = True
handled_exception = None