mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-11-24 00:51:56 +00:00
Fix for --dump-file with multiple tables and --start/--stop mixing tables
This commit is contained in:
parent
3fdf005874
commit
b6761e1825
2 changed files with 5 additions and 2 deletions
|
|
@ -75,6 +75,7 @@ class Dump(object):
|
|||
self._outputFile = None
|
||||
self._outputFP = None
|
||||
self._lock = threading.Lock()
|
||||
self._dumpFiles = {} # Note: dump file -> table (written during this run)
|
||||
|
||||
def _write(self, data, newline=True, console=True, content_type=None):
|
||||
text = "%s%s" % (data, "\n" if newline else " ")
|
||||
|
|
@ -513,7 +514,8 @@ class Dump(object):
|
|||
else:
|
||||
dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (safeTable, conf.dumpFormat.lower()))
|
||||
else:
|
||||
appendToFile = any((conf.limitStart, conf.limitStop))
|
||||
# Note: appending (e.g. of --start/--stop ranges) only to the same table's file (i.e. not to a --dump-file shared among multiple tables)
|
||||
appendToFile = any((conf.limitStart, conf.limitStop)) and self._dumpFiles.get(dumpFileName, table) == table
|
||||
|
||||
if not appendToFile:
|
||||
count = 1
|
||||
|
|
@ -528,6 +530,7 @@ class Dump(object):
|
|||
else:
|
||||
count += 1
|
||||
|
||||
self._dumpFiles[dumpFileName] = table
|
||||
dumpFP = openFile(dumpFileName, 'w' if not appendToFile else 'a', buffering=DUMP_FILE_BUFFER_SIZE)
|
||||
|
||||
count = int(tableValues["__infos__"]["count"])
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.11.55"
|
||||
VERSION = "1.10.11.56"
|
||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
||||
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue