Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit be26392

Browse files
committed
Update for an Issue #1846
1 parent 263730f commit be26392

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from lib.core.revision import getRevisionNumber
2020

2121
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
22-
VERSION = "1.0.5.11"
22+
VERSION = "1.0.5.12"
2323
REVISION = getRevisionNumber()
2424
STABLE = VERSION.count('.') <= 2
2525
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")

sqlmap.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from lib.utils import versioncheck # this has to be the first non-standard import
1313

1414
import bdb
15+
import distutils
1516
import inspect
1617
import logging
1718
import os
@@ -49,6 +50,7 @@
4950
from lib.core.option import init
5051
from lib.core.profiling import profile
5152
from lib.core.settings import LEGAL_DISCLAIMER
53+
from lib.core.settings import VERSION
5254
from lib.core.testing import smokeTest
5355
from lib.core.testing import liveTest
5456
from lib.parse.cmdline import cmdLineParser
@@ -68,21 +70,33 @@ def modulePath():
6870

6971
return getUnicode(os.path.dirname(os.path.realpath(_)), encoding=sys.getfilesystemencoding())
7072

73+
def checkEnvironment():
74+
paths.SQLMAP_ROOT_PATH = modulePath()
75+
76+
try:
77+
os.path.isdir(paths.SQLMAP_ROOT_PATH)
78+
except UnicodeEncodeError:
79+
errMsg = "your system does not properly handle non-ASCII paths. "
80+
errMsg += "Please move the sqlmap's directory to the other location"
81+
logger.critical(errMsg)
82+
raise SystemExit
83+
84+
#if distutils.version.LooseVersion(VERSION) < distutils.version.LooseVersion("1.0"):
85+
if True:
86+
errMsg = "your runtime environment (e.g. PYTHONPATH) is "
87+
errMsg += "broken. Please make sure that you are not running "
88+
errMsg += "newer versions of sqlmap with runtime scripts for older "
89+
errMsg += "versions"
90+
logger.critical(errMsg)
91+
raise SystemExit
92+
7193
def main():
7294
"""
7395
Main function of sqlmap when running from command line.
7496
"""
7597

7698
try:
77-
paths.SQLMAP_ROOT_PATH = modulePath()
78-
79-
try:
80-
os.path.isdir(paths.SQLMAP_ROOT_PATH)
81-
except UnicodeEncodeError:
82-
errMsg = "your system does not properly handle non-ASCII paths. "
83-
errMsg += "Please move the sqlmap's directory to the other location"
84-
logger.error(errMsg)
85-
raise SystemExit
99+
checkEnvironment()
86100

87101
setPaths()
88102
banner()

0 commit comments

Comments
 (0)