From 10152db8ee88b1d0126102fc64d72a297c8c7657 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 6 Jun 2019 13:40:32 +0200 Subject: [PATCH] Minor patch for PIP --smoke --- lib/core/settings.py | 2 +- sqlmapapi.py | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/core/settings.py b/lib/core/settings.py index dc3faa4a0..cf2f30f62 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -18,7 +18,7 @@ from lib.core.enums import OS from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.3.6.26" +VERSION = "1.3.6.27" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) diff --git a/sqlmapapi.py b/sqlmapapi.py index e491417dd..28da90369 100755 --- a/sqlmapapi.py +++ b/sqlmapapi.py @@ -13,12 +13,13 @@ __import__("lib.utils.versioncheck") # this has to be the first non-standard im import logging import optparse +import os import warnings warnings.filterwarnings(action="ignore", message=".*was already imported", category=UserWarning) warnings.filterwarnings(action="ignore", category=DeprecationWarning) -from sqlmap import modulePath +from lib.core.common import getUnicode from lib.core.common import setPaths from lib.core.data import logger from lib.core.patch import dirtyPatches @@ -26,9 +27,16 @@ from lib.core.patch import resolveCrossReferences from lib.core.settings import RESTAPI_DEFAULT_ADAPTER from lib.core.settings import RESTAPI_DEFAULT_ADDRESS from lib.core.settings import RESTAPI_DEFAULT_PORT +from lib.core.settings import UNICODE_ENCODING from lib.utils.api import client from lib.utils.api import server +try: + from sqlmap import modulePath +except ImportError: + def modulePath(): + return getUnicode(os.path.dirname(os.path.realpath(__file__)), encoding=sys.getfilesystemencoding() or UNICODE_ENCODING) + def main(): """ REST-JSON API main function