mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-07-08 17:43:52 +00:00
Some more stabilization of unittests
This commit is contained in:
parent
71d9c6d0f4
commit
d60e95ede7
20 changed files with 122 additions and 33 deletions
|
|
@ -2099,7 +2099,9 @@ def getFileType(filePath):
|
|||
desc = getText(desc)
|
||||
|
||||
if desc == getText(magic.MAGIC_UNKNOWN_FILETYPE):
|
||||
content = openFile(filePath, "rb", encoding=None).read()
|
||||
_ = openFile(filePath, "rb", encoding=None)
|
||||
content = _.read()
|
||||
_.close()
|
||||
|
||||
try:
|
||||
content.decode()
|
||||
|
|
|
|||
|
|
@ -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.20"
|
||||
VERSION = "1.10.7.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)
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ def configFileParser(configFile):
|
|||
except Exception as ex:
|
||||
errMsg = "you have provided an invalid and/or unreadable configuration file ('%s')" % getSafeExString(ex)
|
||||
raise SqlmapSyntaxException(errMsg)
|
||||
finally:
|
||||
configFP.close()
|
||||
|
||||
if not config.has_section("Target"):
|
||||
errMsg = "missing a mandatory section 'Target' in the configuration file"
|
||||
|
|
|
|||
|
|
@ -1225,6 +1225,7 @@ def _bruteProcessVariantA(attack_info, hash_regex, suffix, retVal, proc_id, proc
|
|||
pass
|
||||
|
||||
finally:
|
||||
wordlist.closeFP() # release the wordlist file handle (else it leaks; Windows can't rmtree an open file)
|
||||
if hasattr(proc_count, "value"):
|
||||
with proc_count.get_lock():
|
||||
proc_count.value -= 1
|
||||
|
|
@ -1304,6 +1305,7 @@ def _bruteProcessVariantB(user, hash_, kwargs, hash_regex, suffix, retVal, found
|
|||
pass
|
||||
|
||||
finally:
|
||||
wordlist.closeFP() # release the wordlist file handle (else it leaks; Windows can't rmtree an open file)
|
||||
if hasattr(proc_count, "value"):
|
||||
with proc_count.get_lock():
|
||||
proc_count.value -= 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue