mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-07 17:14:18 +00:00
Fixing the CI/CD failure
This commit is contained in:
parent
788c9fa134
commit
05f81ab191
3 changed files with 16 additions and 8 deletions
|
|
@ -20,7 +20,7 @@ from lib.core.enums import OS
|
|||
from thirdparty import six
|
||||
|
||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||
VERSION = "1.10.7.33"
|
||||
VERSION = "1.10.7.34"
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -424,7 +424,10 @@ def _threadedInferenceValues(exprBuilder, indices, context=None, charsetType=Non
|
|||
|
||||
indices = list(indices)
|
||||
|
||||
savedTechnique = getTechnique()
|
||||
# Snapshot the raw per-thread technique (may be None) so the finally can restore it verbatim -
|
||||
# getTechnique() would fall back to kb.technique, and a None result there used to skip the restore
|
||||
# entirely, leaking the BOOLEAN/TIME we set below onto the calling thread for every later caller.
|
||||
savedTechnique = getCurrentThreadData().technique
|
||||
|
||||
if isTechniqueAvailable(PAYLOAD.TECHNIQUE.BOOLEAN):
|
||||
setTechnique(PAYLOAD.TECHNIQUE.BOOLEAN)
|
||||
|
|
@ -433,8 +436,12 @@ def _threadedInferenceValues(exprBuilder, indices, context=None, charsetType=Non
|
|||
else:
|
||||
return None
|
||||
|
||||
initTechnique(getTechnique())
|
||||
payload = agent.payload(newValue=agent.suffixQuery(agent.prefixQuery(getTechniqueData().vector)))
|
||||
try:
|
||||
initTechnique(getTechnique())
|
||||
payload = agent.payload(newValue=agent.suffixQuery(agent.prefixQuery(getTechniqueData().vector)))
|
||||
except:
|
||||
setTechnique(savedTechnique) # these run before the runThreads try/finally below, so restore here too
|
||||
raise
|
||||
|
||||
results = [None] * len(indices)
|
||||
cursor = iter(xrange(len(indices)))
|
||||
|
|
@ -501,8 +508,7 @@ def _threadedInferenceValues(exprBuilder, indices, context=None, charsetType=Non
|
|||
kb.partRun = savedPartRun
|
||||
mainThreadData.disableStdOut = savedStdOut
|
||||
mainThreadData.shared = savedShared
|
||||
if savedTechnique is not None:
|
||||
setTechnique(savedTechnique)
|
||||
setTechnique(savedTechnique)
|
||||
|
||||
# Robustness: any slot a worker could not retrieve (None, i.e. a transient per-cell failure) is
|
||||
# re-extracted serially via the classic getValue() path - full error handling, and a persistent error
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class _BaseEnumTest(unittest.TestCase):
|
|||
|
||||
# conf keys every test may read/write
|
||||
_CONF_KEYS = ("direct", "technique", "db", "tbl", "col", "exclude",
|
||||
"getComments", "excludeSysDbs", "search", "freshQueries")
|
||||
"getComments", "excludeSysDbs", "search", "freshQueries", "threads")
|
||||
|
||||
def setUp(self):
|
||||
self._saved_conf = {k: conf.get(k) for k in self._CONF_KEYS}
|
||||
|
|
@ -117,6 +117,7 @@ class _BaseEnumTest(unittest.TestCase):
|
|||
"""Take the blind inference branch: conf.direct off, a BOOLEAN technique present."""
|
||||
conf.direct = False
|
||||
conf.technique = None
|
||||
conf.threads = 1 # exercise the serial getValue() path these tests mock (>1 takes the value-parallel branch)
|
||||
kb.injection.data = {PAYLOAD.TECHNIQUE.BOOLEAN: {"title": "AND boolean-based blind"}}
|
||||
|
||||
|
||||
|
|
@ -533,7 +534,7 @@ class TestGetProcedures(_BaseEnumTest):
|
|||
|
||||
class _DbBase(unittest.TestCase):
|
||||
_CONF_KEYS = ("direct", "technique", "db", "tbl", "col", "exclude",
|
||||
"getComments", "excludeSysDbs", "search", "freshQueries")
|
||||
"getComments", "excludeSysDbs", "search", "freshQueries", "threads")
|
||||
|
||||
def setUp(self):
|
||||
self._saved_conf = {k: conf.get(k) for k in self._CONF_KEYS}
|
||||
|
|
@ -588,6 +589,7 @@ class _DbBase(unittest.TestCase):
|
|||
def _inference(self):
|
||||
conf.direct = False
|
||||
conf.technique = None
|
||||
conf.threads = 1 # exercise the serial getValue() path these tests mock (>1 takes the value-parallel branch)
|
||||
kb.injection.data = {PAYLOAD.TECHNIQUE.BOOLEAN: {"title": "AND boolean-based blind"}}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue