File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -430,15 +430,7 @@ def dbTableValues(self, tableValues):
430430 try :
431431 os .makedirs (dumpDbPath )
432432 except Exception as ex :
433- try :
434- tempDir = tempfile .mkdtemp (prefix = "sqlmapdb" )
435- except IOError as _ :
436- errMsg = "unable to write to the temporary directory ('%s'). " % _
437- errMsg += "Please make sure that your disk is not full and "
438- errMsg += "that you have sufficient write permissions to "
439- errMsg += "create temporary files and/or directories"
440- raise SqlmapSystemException (errMsg )
441-
433+ tempDir = tempfile .mkdtemp (prefix = "sqlmapdb" )
442434 warnMsg = "unable to create dump directory "
443435 warnMsg += "'%s' (%s). " % (dumpDbPath , getSafeExString (ex ))
444436 warnMsg += "Using temporary directory '%s' instead" % tempDir
Original file line number Diff line number Diff line change @@ -1499,15 +1499,7 @@ def _createHomeDirectories():
14991499 warnMsg = "using '%s' as the %s directory" % (directory , context )
15001500 logger .warn (warnMsg )
15011501 except (OSError , IOError ) as ex :
1502- try :
1503- tempDir = tempfile .mkdtemp (prefix = "sqlmap%s" % context )
1504- except Exception as _ :
1505- errMsg = "unable to write to the temporary directory ('%s'). " % _
1506- errMsg += "Please make sure that your disk is not full and "
1507- errMsg += "that you have sufficient write permissions to "
1508- errMsg += "create temporary files and/or directories"
1509- raise SqlmapSystemException (errMsg )
1510-
1502+ tempDir = tempfile .mkdtemp (prefix = "sqlmap%s" % context )
15111503 warnMsg = "unable to %s %s directory " % ("create" if not os .path .isdir (directory ) else "write to the" , context )
15121504 warnMsg += "'%s' (%s). " % (directory , getUnicode (ex ))
15131505 warnMsg += "Using temporary directory '%s' instead" % getUnicode (tempDir )
Original file line number Diff line number Diff line change 1818from thirdparty import six
1919
2020# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21- VERSION = "1.3.5.63 "
21+ VERSION = "1.3.5.64 "
2222TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2323TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2424VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
Original file line number Diff line number Diff line change @@ -638,15 +638,7 @@ def _createTargetDirs():
638638 if not os .path .isdir (conf .outputPath ):
639639 os .makedirs (conf .outputPath )
640640 except (OSError , IOError , TypeError ) as ex :
641- try :
642- tempDir = tempfile .mkdtemp (prefix = "sqlmapoutput" )
643- except Exception as _ :
644- errMsg = "unable to write to the temporary directory ('%s'). " % _
645- errMsg += "Please make sure that your disk is not full and "
646- errMsg += "that you have sufficient write permissions to "
647- errMsg += "create temporary files and/or directories"
648- raise SqlmapSystemException (errMsg )
649-
641+ tempDir = tempfile .mkdtemp (prefix = "sqlmapoutput" )
650642 warnMsg = "unable to create output directory "
651643 warnMsg += "'%s' (%s). " % (conf .outputPath , getUnicode (ex ))
652644 warnMsg += "Using temporary directory '%s' instead" % getUnicode (tempDir )
Original file line number Diff line number Diff line change 55See the file 'LICENSE' for copying permission
66"""
77
8- import os
98import sys
109import time
1110
Original file line number Diff line number Diff line change 2727 import re
2828 import shutil
2929 import sys
30+ import tempfile
3031 import threading
3132 import time
3233 import traceback
@@ -284,6 +285,14 @@ def main():
284285 logger .critical (errMsg )
285286 raise SystemExit
286287
288+ elif any (_ in excMsg for _ in ("tempfile.mkdtemp" , "tempfile.mkstemp" )):
289+ errMsg = "unable to write to the temporary directory '%s'. " % tempfile .gettempdir ()
290+ errMsg += "Please make sure that your disk is not full and "
291+ errMsg += "that you have sufficient write permissions to "
292+ errMsg += "create temporary files and/or directories"
293+ logger .critical (errMsg )
294+ raise SystemExit
295+
287296 elif all (_ in excMsg for _ in ("twophase" , "sqlalchemy" )):
288297 errMsg = "please update the 'sqlalchemy' package (>= 1.1.11) "
289298 errMsg += "(Reference: https://qiita.com/tkprof/items/7d7b2d00df9c5f16fffe)"
You can’t perform that action at this time.
0 commit comments