During --flush-session log file should be cleaned too (especially because of --live-tests)

This commit is contained in:
Miroslav Stampar 2012-12-19 14:28:54 +01:00
parent d80744d3d5
commit 244901eda0

View File

@ -65,7 +65,7 @@ class Dump(object):
def setOutputFile(self): def setOutputFile(self):
self._outputFile = "%s%slog" % (conf.outputPath, os.sep) self._outputFile = "%s%slog" % (conf.outputPath, os.sep)
try: try:
self._outputFP = codecs.open(self._outputFile, "ab", UNICODE_ENCODING) self._outputFP = codecs.open(self._outputFile, "ab" if not conf.flushSession else "wb", UNICODE_ENCODING)
except IOError, ex: except IOError, ex:
errMsg = "error occurred while opening log file ('%s')" % ex errMsg = "error occurred while opening log file ('%s')" % ex
raise SqlmapGenericException, errMsg raise SqlmapGenericException, errMsg