Skip to content

Commit eb8e31c

Browse files
committed
Adding a failsafe output directory
1 parent b54651b commit eb8e31c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/core/common.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,10 @@ def setPaths():
10381038
paths.SQLMAP_XML_PATH = os.path.join(paths.SQLMAP_ROOT_PATH, "xml")
10391039
paths.SQLMAP_XML_BANNER_PATH = os.path.join(paths.SQLMAP_XML_PATH, "banner")
10401040
paths.SQLMAP_OUTPUT_PATH = paths.get("SQLMAP_OUTPUT_PATH", os.path.join(paths.SQLMAP_ROOT_PATH, "output"))
1041+
1042+
if not os.access(paths.SQLMAP_OUTPUT_PATH, os.W_OK):
1043+
paths.SQLMAP_OUTPUT_PATH = os.path.join(os.path.expanduser("~"), ".sqlmap", "output")
1044+
10411045
paths.SQLMAP_DUMP_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "dump")
10421046
paths.SQLMAP_FILES_PATH = os.path.join(paths.SQLMAP_OUTPUT_PATH, "%s", "files")
10431047

0 commit comments

Comments
 (0)