Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef5ce7e

Browse files
committed
Fix for an Issue #670
1 parent fd884ec commit ef5ce7e

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

lib/core/target.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,16 @@ def _createFilesDir():
462462
conf.filePath = paths.SQLMAP_FILES_PATH % conf.hostname
463463

464464
if not os.path.isdir(conf.filePath):
465-
os.makedirs(conf.filePath, 0755)
465+
try:
466+
os.makedirs(conf.filePath, 0755)
467+
except OSError, ex:
468+
tempDir = tempfile.mkdtemp(prefix="sqlmapfiles")
469+
warnMsg = "unable to create files directory "
470+
warnMsg += "'%s' (%s). " % (conf.filePath, ex)
471+
warnMsg += "Using temporary directory '%s' instead" % tempDir
472+
logger.warn(warnMsg)
473+
474+
conf.filePath = tempDir
466475

467476
def _createDumpDir():
468477
"""

0 commit comments

Comments
 (0)