From 7e7513aa5e6ea99a4bf566c7c38869e95ad63490 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 14 Jan 2015 05:30:08 +0100 Subject: [PATCH] Patch for an Issue #1107 --- lib/core/option.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/core/option.py b/lib/core/option.py index 03c5b5300..6ab4e8d93 100644 --- a/lib/core/option.py +++ b/lib/core/option.py @@ -1443,8 +1443,16 @@ def _createTemporaryDirectory(): Creates temporary directory for this run. """ - if not os.path.isdir(tempfile.gettempdir()): - os.makedirs(tempfile.gettempdir()) + try: + if not os.path.isdir(tempfile.gettempdir()): + os.makedirs(tempfile.gettempdir()) + except IOError, ex: + errMsg = "there has been a problem while accessing " + errMsg += "system's temporary directory location(s) ('%s'). Please " % ex + errMsg += "make sure that there is enough disk space left. If problem persists, " + errMsg += "try to set environment variable 'TMP' to a location " + errMsg += "writeable by the current user" + raise SqlmapSystemException, errMsg kb.tempDir = tempfile.tempdir = tempfile.mkdtemp(prefix="sqlmap", suffix=str(os.getpid())) if not os.path.isdir(tempfile.tempdir): os.makedirs(tempfile.tempdir)