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

Function getPartRun

lib/core/common.py:2666–2701  ·  view source on GitHub ↗

Goes through call stack and finds constructs matching conf.dbmsHandler.*. Returns it or its alias used in 'txt/common-outputs.txt'

(alias=True)

Source from the content-addressed store, hash-verified

2664 return None, None, None, originalCharset
2665
2666def getPartRun(alias=True):
2667 """
2668 Goes through call stack and finds constructs matching
2669 conf.dbmsHandler.*. Returns it or its alias used in 'txt/common-outputs.txt'
2670 """
2671
2672 retVal = None
2673 commonPartsDict = optDict["Enumeration"]
2674
2675 try:
2676 stack = [item[4][0] if isinstance(item[4], list) else '' for item in inspect.stack()]
2677
2678 # Goes backwards through the stack to find the conf.dbmsHandler method
2679 # calling this function
2680 for i in xrange(0, len(stack) - 1):
2681 for regex in (r"self\.(get[^(]+)\(\)", r"conf\.dbmsHandler\.([^(]+)\(\)"):
2682 match = re.search(regex, stack[i])
2683
2684 if match:
2685 # This is the calling conf.dbmsHandler or self method
2686 # (e.g. 'getDbms')
2687 retVal = match.groups()[0]
2688 break
2689
2690 if retVal is not None:
2691 break
2692
2693 # Reference: http://coding.derkeiler.com/Archive/Python/comp.lang.python/2004-06/2267.html
2694 except TypeError:
2695 pass
2696
2697 # Return the INI tag to consider for common outputs (e.g. 'Databases')
2698 if alias:
2699 return commonPartsDict[retVal][1] if isinstance(commonPartsDict.get(retVal), tuple) else retVal
2700 else:
2701 return retVal
2702
2703def longestCommonPrefix(*sequences):
2704 """

Callers 3

unionUseFunction · 0.90
bisectionFunction · 0.90
errorUseFunction · 0.90

Calls 3

xrangeClass · 0.85
searchMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…