From 374f38fdce309a796b1583fd5179f115acd56e70 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Wed, 29 Sep 2021 19:45:04 +0200 Subject: [PATCH] Minor patch of doctests for Windows machine --- lib/core/common.py | 14 +++++--------- lib/core/settings.py | 2 +- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 7de61f0ff..9506e68bb 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -5017,18 +5017,14 @@ def decloakToTemp(filename): """ Decloaks content of a given file to a temporary file with similar name and extension - >>> _ = decloakToTemp(os.path.join(paths.SQLMAP_SHELL_PATH, "stagers", "stager.asp_")) - >>> openFile(_, "rb", encoding=None).read().startswith(b'<%') + NOTE: using in-memory decloak() in docTests because of the "problem" on Windows platform + + >>> decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "stagers", "stager.asp_")).startswith(b'<%') True - >>> os.remove(_) - >>> _ = decloakToTemp(os.path.join(paths.SQLMAP_SHELL_PATH, "backdoors", "backdoor.asp_")) - >>> openFile(_, "rb", encoding=None).read().startswith(b'<%') + >>> decloak(os.path.join(paths.SQLMAP_SHELL_PATH, "backdoors", "backdoor.asp_")).startswith(b'<%') True - >>> os.remove(_) - >>> _ = decloakToTemp(os.path.join(paths.SQLMAP_UDF_PATH, "postgresql", "linux", "64", "11", "lib_postgresqludf_sys.so_")) - >>> b'sys_eval' in openFile(_, "rb", encoding=None).read() + >>> b'sys_eval' in decloak(os.path.join(paths.SQLMAP_UDF_PATH, "postgresql", "linux", "64", "11", "lib_postgresqludf_sys.so_")) True - >>> os.remove(_) """ content = decloak(filename) diff --git a/lib/core/settings.py b/lib/core/settings.py index b9b5bf7d7..2b15aa668 100644 --- a/lib/core/settings.py +++ b/lib/core/settings.py @@ -20,7 +20,7 @@ from thirdparty import six from thirdparty.six import unichr as _unichr # sqlmap version (...) -VERSION = "1.5.9.20" +VERSION = "1.5.9.21" 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)