|
11 | 11 | from lib.core.common import openFile
|
12 | 12 | from lib.core.common import unArrayizeValue
|
13 | 13 | from lib.core.common import UnicodeRawConfigParser
|
| 14 | +from lib.core.data import cmdLineOptions |
14 | 15 | from lib.core.data import conf
|
15 | 16 | from lib.core.data import logger
|
16 | 17 | from lib.core.exception import SqlmapMissingMandatoryOptionException
|
@@ -75,16 +76,14 @@ def configFileParser(configFile):
|
75 | 76 | errMsg = "missing a mandatory section 'Target' in the configuration file"
|
76 | 77 | raise SqlmapMissingMandatoryOptionException(errMsg)
|
77 | 78 |
|
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 |
86 | 80 |
|
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: |
88 | 87 | errMsg = "missing a mandatory option in the configuration file "
|
89 | 88 | errMsg += "(direct, url, logFile, bulkFile, googleDork, requestFile, sitemapUrl or wizard)"
|
90 | 89 | raise SqlmapMissingMandatoryOptionException(errMsg)
|
|
0 commit comments