if the user forces the DBMS, then sort the tests accordingly to perform first the DBMS-specific tests, then the others

This commit is contained in:
Bernardo Damele 2015-02-21 13:12:03 +00:00
parent d235ee375b
commit 383929c0c2

View File

@ -438,10 +438,9 @@ class Backend:
This functions is called to: This functions is called to:
1. Sort the tests, getSortedInjectionTests() - detection phase. 1. Ask user whether or not skip specific DBMS tests in detection phase,
2. Ask user whether or not skip specific DBMS tests in detection phase,
lib/controller/checks.py - detection phase. lib/controller/checks.py - detection phase.
3. Sort the fingerprint of the DBMS, lib/controller/handler.py - 2. Sort the fingerprint of the DBMS, lib/controller/handler.py -
fingerprint phase. fingerprint phase.
""" """
@ -449,6 +448,13 @@ class Backend:
@staticmethod @staticmethod
def getIdentifiedDbms(): def getIdentifiedDbms():
"""
This functions is called to:
1. Sort the tests, getSortedInjectionTests() - detection phase.
2. Etc.
"""
dbms = None dbms = None
if not kb: if not kb:
@ -2823,14 +2829,14 @@ def getSortedInjectionTests():
retVal = SORT_ORDER.LAST retVal = SORT_ORDER.LAST
elif 'details' in test and 'dbms' in test.details: elif 'details' in test and 'dbms' in test.details:
if intersect(test.details.dbms, Backend.getErrorParsedDBMSes()): if intersect(test.details.dbms, Backend.getIdentifiedDbms()):
retVal = SORT_ORDER.SECOND retVal = SORT_ORDER.SECOND
else: else:
retVal = SORT_ORDER.THIRD retVal = SORT_ORDER.THIRD
return retVal return retVal
if Backend.getErrorParsedDBMSes(): if Backend.getIdentifiedDbms():
retVal = sorted(retVal, key=priorityFunction) retVal = sorted(retVal, key=priorityFunction)
return retVal return retVal