MCPcopy Index your code
hub / github.com/sqlmapproject/sqlmap / _createHomeDirectories

Function _createHomeDirectories

lib/core/option.py:1581–1609  ·  view source on GitHub ↗

Creates directories inside sqlmap's home directory

()

Source from the content-addressed store, hash-verified

1579 checkDependencies()
1580
1581def _createHomeDirectories():
1582 """
1583 Creates directories inside sqlmap's home directory
1584 """
1585
1586 if conf.get("purge"):
1587 return
1588
1589 for context in ("output", "history"):
1590 directory = paths["SQLMAP_%s_PATH" % getUnicode(context).upper()] # NOTE: https://github.com/sqlmapproject/sqlmap/issues/4363
1591 try:
1592 if not os.path.isdir(directory):
1593 os.makedirs(directory)
1594
1595 _ = os.path.join(directory, randomStr())
1596 open(_, "w+b").close()
1597 os.remove(_)
1598
1599 if conf.get("outputDir") and context == "output":
1600 warnMsg = "using '%s' as the %s directory" % (directory, context)
1601 logger.warning(warnMsg)
1602 except (OSError, IOError) as ex:
1603 tempDir = tempfile.mkdtemp(prefix="sqlmap%s" % context)
1604 warnMsg = "unable to %s %s directory " % ("create" if not os.path.isdir(directory) else "write to the", context)
1605 warnMsg += "'%s' (%s). " % (directory, getUnicode(ex))
1606 warnMsg += "Using temporary directory '%s' instead" % getUnicode(tempDir)
1607 logger.warning(warnMsg)
1608
1609 paths["SQLMAP_%s_PATH" % context.upper()] = tempDir
1610
1611def _pympTempLeakPatch(tempDir): # Cross-referenced function
1612 raise NotImplementedError

Callers 2

cmdLineParserFunction · 0.90
initFunction · 0.85

Calls 5

getUnicodeFunction · 0.90
randomStrFunction · 0.90
removeMethod · 0.80
getMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…