Update for an Issue #1846

This commit is contained in:
Miroslav Stampar 2016-05-06 10:23:57 +02:00
parent 263730f4ee
commit be26392057
2 changed files with 24 additions and 10 deletions

View File

@ -19,7 +19,7 @@ from lib.core.enums import OS
from lib.core.revision import getRevisionNumber from lib.core.revision import getRevisionNumber
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.0.5.11" VERSION = "1.0.5.12"
REVISION = getRevisionNumber() REVISION = getRevisionNumber()
STABLE = VERSION.count('.') <= 2 STABLE = VERSION.count('.') <= 2
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

View File

@ -12,6 +12,7 @@ sys.dont_write_bytecode = True
from lib.utils import versioncheck # this has to be the first non-standard import from lib.utils import versioncheck # this has to be the first non-standard import
import bdb import bdb
import distutils
import inspect import inspect
import logging import logging
import os import os
@ -49,6 +50,7 @@ from lib.core.option import initOptions
from lib.core.option import init from lib.core.option import init
from lib.core.profiling import profile from lib.core.profiling import profile
from lib.core.settings import LEGAL_DISCLAIMER from lib.core.settings import LEGAL_DISCLAIMER
from lib.core.settings import VERSION
from lib.core.testing import smokeTest from lib.core.testing import smokeTest
from lib.core.testing import liveTest from lib.core.testing import liveTest
from lib.parse.cmdline import cmdLineParser from lib.parse.cmdline import cmdLineParser
@ -68,12 +70,7 @@ def modulePath():
return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding()) return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding())
def main(): def checkEnvironment():
"""
Main function of sqlmap when running from command line.
"""
try:
paths.SQLMAP_ROOT_PATH = modulePath() paths.SQLMAP_ROOT_PATH = modulePath()
try: try:
@ -81,9 +78,26 @@ def main():
except UnicodeEncodeError: except UnicodeEncodeError:
errMsg = "your system does not properly handle non-ASCII paths. " errMsg = "your system does not properly handle non-ASCII paths. "
errMsg += "Please move the sqlmap's directory to the other location" errMsg += "Please move the sqlmap's directory to the other location"
logger.error(errMsg) logger.critical(errMsg)
raise SystemExit raise SystemExit
#if distutils.version.LooseVersion(VERSION) < distutils.version.LooseVersion("1.0"):
if True:
errMsg = "your runtime environment (e.g. PYTHONPATH) is "
errMsg += "broken. Please make sure that you are not running "
errMsg += "newer versions of sqlmap with runtime scripts for older "
errMsg += "versions"
logger.critical(errMsg)
raise SystemExit
def main():
"""
Main function of sqlmap when running from command line.
"""
try:
checkEnvironment()
setPaths() setPaths()
banner() banner()