mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-07-29 17:39:56 +03:00
Refactoring for compatible with Python 3
* transformation: numliterals
This commit is contained in:
parent
9e75bb7f68
commit
53c688fae5
|
@ -414,7 +414,7 @@ class Dump(object):
|
|||
elif conf.dumpFormat in (DUMP_FORMAT.CSV, DUMP_FORMAT.HTML):
|
||||
if not os.path.isdir(dumpDbPath):
|
||||
try:
|
||||
os.makedirs(dumpDbPath, 0755)
|
||||
os.makedirs(dumpDbPath, 0o755)
|
||||
except:
|
||||
warnFile = True
|
||||
|
||||
|
@ -423,7 +423,7 @@ class Dump(object):
|
|||
|
||||
if not os.path.isdir(dumpDbPath):
|
||||
try:
|
||||
os.makedirs(dumpDbPath, 0755)
|
||||
os.makedirs(dumpDbPath, 0o755)
|
||||
except Exception, ex:
|
||||
try:
|
||||
tempDir = tempfile.mkdtemp(prefix="sqlmapdb")
|
||||
|
@ -611,7 +611,7 @@ class Dump(object):
|
|||
mimetype = magic.from_buffer(value, mime=True)
|
||||
if any(mimetype.startswith(_) for _ in ("application", "image")):
|
||||
if not os.path.isdir(dumpDbPath):
|
||||
os.makedirs(dumpDbPath, 0755)
|
||||
os.makedirs(dumpDbPath, 0o755)
|
||||
|
||||
_ = re.sub(r"[^\w]", "_", normalizeUnicode(unsafeSQLIdentificatorNaming(column)))
|
||||
filepath = os.path.join(dumpDbPath, "%s-%d.bin" % (_, randomInt(8)))
|
||||
|
|
|
@ -581,7 +581,7 @@ def _createFilesDir():
|
|||
|
||||
if not os.path.isdir(conf.filePath):
|
||||
try:
|
||||
os.makedirs(conf.filePath, 0755)
|
||||
os.makedirs(conf.filePath, 0o755)
|
||||
except OSError, ex:
|
||||
tempDir = tempfile.mkdtemp(prefix="sqlmapfiles")
|
||||
warnMsg = "unable to create files directory "
|
||||
|
@ -603,7 +603,7 @@ def _createDumpDir():
|
|||
|
||||
if not os.path.isdir(conf.dumpPath):
|
||||
try:
|
||||
os.makedirs(conf.dumpPath, 0755)
|
||||
os.makedirs(conf.dumpPath, 0o755)
|
||||
except OSError, ex:
|
||||
tempDir = tempfile.mkdtemp(prefix="sqlmapdump")
|
||||
warnMsg = "unable to create dump directory "
|
||||
|
@ -624,7 +624,7 @@ def _createTargetDirs():
|
|||
|
||||
try:
|
||||
if not os.path.isdir(paths.SQLMAP_OUTPUT_PATH):
|
||||
os.makedirs(paths.SQLMAP_OUTPUT_PATH, 0755)
|
||||
os.makedirs(paths.SQLMAP_OUTPUT_PATH, 0o755)
|
||||
|
||||
_ = os.path.join(paths.SQLMAP_OUTPUT_PATH, randomStr())
|
||||
open(_, "w+b").close()
|
||||
|
@ -654,7 +654,7 @@ def _createTargetDirs():
|
|||
|
||||
try:
|
||||
if not os.path.isdir(conf.outputPath):
|
||||
os.makedirs(conf.outputPath, 0755)
|
||||
os.makedirs(conf.outputPath, 0o755)
|
||||
except (OSError, IOError, TypeError), ex:
|
||||
try:
|
||||
tempDir = tempfile.mkdtemp(prefix="sqlmapoutput")
|
||||
|
|
Loading…
Reference in New Issue
Block a user