Skip to content

Commit a90913c

Browse files
committed
Proper patch for #1723
1 parent 256b198 commit a90913c

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/core/option.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2165,7 +2165,6 @@ def _mergeOptions(inputOptions, overrideOptions):
21652165
if hasattr(conf, key) and conf[key] is None:
21662166
conf[key] = value
21672167

2168-
21692168
lut = {}
21702169
for group in optDict.keys():
21712170
lut.update((_.upper(), _) for _ in optDict[group])

lib/parse/configfile.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from lib.core.common import openFile
1212
from lib.core.common import unArrayizeValue
1313
from lib.core.common import UnicodeRawConfigParser
14+
from lib.core.data import cmdLineOptions
1415
from lib.core.data import conf
1516
from lib.core.data import logger
1617
from lib.core.exception import SqlmapMissingMandatoryOptionException
@@ -75,16 +76,14 @@ def configFileParser(configFile):
7576
errMsg = "missing a mandatory section 'Target' in the configuration file"
7677
raise SqlmapMissingMandatoryOptionException(errMsg)
7778

78-
condition = not config.has_option("Target", "direct")
79-
condition &= not config.has_option("Target", "url")
80-
condition &= not config.has_option("Target", "logFile")
81-
condition &= not config.has_option("Target", "bulkFile")
82-
condition &= not config.has_option("Target", "googleDork")
83-
condition &= not config.has_option("Target", "requestFile")
84-
condition &= not config.has_option("Target", "sitemapUrl")
85-
condition &= not config.has_option("Target", "wizard")
79+
mandatory = False
8680

87-
if condition:
81+
for option in ("direct", "url", "logFile", "bulkFile", "googleDork", "requestFile", "sitemapUrl", "wizard"):
82+
if config.has_option("Target", option) and config.get("Target", option) or cmdLineOptions.get(option):
83+
mandatory = True
84+
break
85+
86+
if not mandatory:
8887
errMsg = "missing a mandatory option in the configuration file "
8988
errMsg += "(direct, url, logFile, bulkFile, googleDork, requestFile, sitemapUrl or wizard)"
9089
raise SqlmapMissingMandatoryOptionException(errMsg)

0 commit comments

Comments
 (0)