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

Function configFileProxy

lib/parse/configfile.py:24–53  ·  view source on GitHub ↗

Parse configuration file and save settings into the configuration advanced dictionary.

(section, option, datatype)

Source from the content-addressed store, hash-verified

22config = None
23
24def configFileProxy(section, option, datatype):
25 """
26 Parse configuration file and save settings into the configuration
27 advanced dictionary.
28 """
29
30 if config.has_option(section, option):
31 try:
32 if datatype == OPTION_TYPE.BOOLEAN:
33 value = config.getboolean(section, option) if config.get(section, option) else False
34 elif datatype == OPTION_TYPE.INTEGER:
35 value = config.getint(section, option) if config.get(section, option) else 0
36 elif datatype == OPTION_TYPE.FLOAT:
37 value = config.getfloat(section, option) if config.get(section, option) else 0.0
38 else:
39 value = config.get(section, option)
40 except ValueError as ex:
41 errMsg = "error occurred while processing the option "
42 errMsg += "'%s' in provided configuration file ('%s')" % (option, getUnicode(ex))
43 raise SqlmapSyntaxException(errMsg)
44
45 if value:
46 conf[option] = value
47 else:
48 conf[option] = None
49 else:
50 debugMsg = "missing requested option '%s' (section " % option
51 debugMsg += "'%s') into the configuration file, " % section
52 debugMsg += "ignoring. Skipping to next."
53 logger.debug(debugMsg)
54
55def configFileParser(configFile):
56 """

Callers 1

configFileParserFunction · 0.85

Calls 4

getUnicodeFunction · 0.90
debugMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…