This commit is contained in:
Lion Yang 2016-02-23 10:11:13 +00:00
commit 19fc3c57a1
2 changed files with 11 additions and 11 deletions

View File

@ -2145,9 +2145,6 @@ def _mergeOptions(inputOptions, overrideOptions):
errMsg += " ('%s')" % ex if ex.message else "" errMsg += " ('%s')" % ex if ex.message else ""
raise SqlmapSyntaxException(errMsg) raise SqlmapSyntaxException(errMsg)
if inputOptions.configFile:
configFileParser(inputOptions.configFile)
if hasattr(inputOptions, "items"): if hasattr(inputOptions, "items"):
inputOptionsItems = inputOptions.items() inputOptionsItems = inputOptions.items()
else: else:
@ -2157,6 +2154,9 @@ def _mergeOptions(inputOptions, overrideOptions):
if key not in conf or value not in (None, False) or overrideOptions: if key not in conf or value not in (None, False) or overrideOptions:
conf[key] = value conf[key] = value
if inputOptions.configFile:
configFileParser(inputOptions.configFile)
for key, value in conf.items(): for key, value in conf.items():
if value is not None: if value is not None:
kb.explicitSettings.add(key) kb.explicitSettings.add(key)

View File

@ -75,14 +75,14 @@ def configFileParser(configFile):
errMsg = "missing a mandatory section 'Target' in the configuration file" errMsg = "missing a mandatory section 'Target' in the configuration file"
raise SqlmapMissingMandatoryOptionException(errMsg) raise SqlmapMissingMandatoryOptionException(errMsg)
condition = not config.has_option("Target", "direct") condition = conf["direct"] == None and not config.has_option("Target", "direct")
condition &= not config.has_option("Target", "url") condition &= conf["url"] == None and not config.has_option("Target", "url")
condition &= not config.has_option("Target", "logFile") condition &= conf["logFile"] == None and not config.has_option("Target", "logFile")
condition &= not config.has_option("Target", "bulkFile") condition &= conf["bulkFile"] == None and not config.has_option("Target", "bulkFile")
condition &= not config.has_option("Target", "googleDork") condition &= conf["googleDork"] == None and not config.has_option("Target", "googleDork")
condition &= not config.has_option("Target", "requestFile") condition &= conf["requestFile"] == None and not config.has_option("Target", "requestFile")
condition &= not config.has_option("Target", "sitemapUrl") condition &= conf["sitemapUrl"] == None and not config.has_option("Target", "sitemapUrl")
condition &= not config.has_option("Target", "wizard") condition &= conf["wizard"] == None and not config.has_option("Target", "wizard")
if condition: if condition:
errMsg = "missing a mandatory option in the configuration file " errMsg = "missing a mandatory option in the configuration file "