mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-01-23 15:54:24 +03:00
Graceful abort in case of an invalid configuration file
This commit is contained in:
parent
bcf754fb17
commit
e3ccf45503
|
@ -8,6 +8,7 @@ See the file 'doc/COPYING' for copying permission
|
||||||
import codecs
|
import codecs
|
||||||
|
|
||||||
from ConfigParser import MissingSectionHeaderError
|
from ConfigParser import MissingSectionHeaderError
|
||||||
|
from ConfigParser import ParsingError
|
||||||
|
|
||||||
from lib.core.common import checkFile
|
from lib.core.common import checkFile
|
||||||
from lib.core.common import unArrayizeValue
|
from lib.core.common import unArrayizeValue
|
||||||
|
@ -64,8 +65,8 @@ def configFileParser(configFile):
|
||||||
try:
|
try:
|
||||||
config = UnicodeRawConfigParser()
|
config = UnicodeRawConfigParser()
|
||||||
config.readfp(configFP)
|
config.readfp(configFP)
|
||||||
except MissingSectionHeaderError:
|
except (MissingSectionHeaderError, ParsingError), ex:
|
||||||
errMsg = "you have provided an invalid configuration file"
|
errMsg = "you have provided an invalid configuration file ('%s')" % str(ex)
|
||||||
raise SqlmapSyntaxException(errMsg)
|
raise SqlmapSyntaxException(errMsg)
|
||||||
|
|
||||||
if not config.has_section("Target"):
|
if not config.has_section("Target"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user