mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-06 12:41:30 +00:00
Performing a backup of old dump file (Issue #841)
This commit is contained in:
@@ -9,6 +9,7 @@ import cgi
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import tempfile
|
||||
import threading
|
||||
|
||||
@@ -452,6 +453,16 @@ class Dump(object):
|
||||
else:
|
||||
appendToFile = any((conf.limitStart, conf.limitStop))
|
||||
|
||||
if not appendToFile:
|
||||
count = 1
|
||||
while True:
|
||||
candidate = "%s.%d" % (dumpFileName, count)
|
||||
if not checkFile(candidate, False):
|
||||
shutil.copyfile(dumpFileName, candidate)
|
||||
break
|
||||
else:
|
||||
count += 1
|
||||
|
||||
dumpFP = openFile(dumpFileName, "wb" if not appendToFile else "ab", buffering=DUMP_FILE_BUFFER_SIZE)
|
||||
|
||||
count = int(tableValues["__infos__"]["count"])
|
||||
|
||||
Reference in New Issue
Block a user