From eb8e31c23fca07b30b66d5b72b81e3ef218ef140 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sun, 27 Apr 2014 22:40:41 +0200 Subject: [PATCH] Adding a failsafe output directory --- lib/core/common.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/core/common.py b/lib/core/common.py index 2e01b1cdc..9a6735678 100755 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1038,6 +1038,10 @@ def setPaths(): paths.SQLMAP_XML_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "xml") paths.SQLMAP_XML_BANNER_PATH = os.path.join(paths.SQLMAP_XML_PATH, "banner") paths.SQLMAP_OUTPUT_PATH = paths.get("SQLMAP_OUTPUT_PATH", os.path.join(paths.SQLMAP_ROOT_PATH, "output")) + + if not os.access(paths.SQLMAP_OUTPUT_PATH, os.W_OK): + paths.SQLMAP_OUTPUT_PATH = os.path.join(os.path.expanduser("~"), ".sqlmap", "output") + paths.SQLMAP_DUMP_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "dump") paths.SQLMAP_FILES_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "files")