From ef5ce7e66c26af2405ea7f0e1da282b99f7cb450 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 12 Apr 2014 17:22:33 +0200 Subject: [PATCH] Fix for an Issue #670 --- lib/core/target.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/core/target.py b/lib/core/target.py index 00bfeaab2..c1c007f1c 100644 --- a/lib/core/target.py +++ b/lib/core/target.py @@ -462,7 +462,16 @@ def _createFilesDir(): conf.filePath = paths.SQLMAP_FILES_PATH % conf.hostname if not os.path.isdir(conf.filePath): - os.makedirs(conf.filePath, 0755) + try: + os.makedirs(conf.filePath, 0755) + except OSError, ex: + tempDir = tempfile.mkdtemp(prefix="sqlmapfiles") + warnMsg = "unable to create files directory " + warnMsg += "'%s' (%s). " % (conf.filePath, ex) + warnMsg += "Using temporary directory '%s' instead" % tempDir + logger.warn(warnMsg) + + conf.filePath = tempDir def _createDumpDir(): """