mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2024-11-25 19:13:48 +03:00
Fixes #5059
This commit is contained in:
parent
d5fb92ee42
commit
52f2faf2cf
|
@ -20,7 +20,7 @@ from thirdparty import six
|
||||||
from thirdparty.six import unichr as _unichr
|
from thirdparty.six import unichr as _unichr
|
||||||
|
|
||||||
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
|
||||||
VERSION = "1.6.4.2"
|
VERSION = "1.6.4.3"
|
||||||
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
|
||||||
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
|
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)
|
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)
|
||||||
|
|
|
@ -119,6 +119,13 @@ def setDaemon(thread):
|
||||||
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True):
|
def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardException=True, threadChoice=False, startThreadMsg=True):
|
||||||
threads = []
|
threads = []
|
||||||
|
|
||||||
|
def _threadFunction():
|
||||||
|
try:
|
||||||
|
threadFunction()
|
||||||
|
finally:
|
||||||
|
if conf.hashDB:
|
||||||
|
conf.hashDB.close()
|
||||||
|
|
||||||
kb.multipleCtrlC = False
|
kb.multipleCtrlC = False
|
||||||
kb.threadContinue = True
|
kb.threadContinue = True
|
||||||
kb.threadException = False
|
kb.threadException = False
|
||||||
|
@ -154,14 +161,14 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio
|
||||||
infoMsg = "starting %d threads" % numThreads
|
infoMsg = "starting %d threads" % numThreads
|
||||||
logger.info(infoMsg)
|
logger.info(infoMsg)
|
||||||
else:
|
else:
|
||||||
threadFunction()
|
_threadFunction()
|
||||||
return
|
return
|
||||||
|
|
||||||
kb.multiThreadMode = True
|
kb.multiThreadMode = True
|
||||||
|
|
||||||
# Start the threads
|
# Start the threads
|
||||||
for numThread in xrange(numThreads):
|
for numThread in xrange(numThreads):
|
||||||
thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[threadFunction])
|
thread = threading.Thread(target=exceptionHandledFunction, name=str(numThread), args=[_threadFunction])
|
||||||
|
|
||||||
setDaemon(thread)
|
setDaemon(thread)
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ class HashDB(object):
|
||||||
threadData = getCurrentThreadData()
|
threadData = getCurrentThreadData()
|
||||||
try:
|
try:
|
||||||
if threadData.hashDBCursor:
|
if threadData.hashDBCursor:
|
||||||
|
threadData.hashDBCursor.connection.commit()
|
||||||
threadData.hashDBCursor.close()
|
threadData.hashDBCursor.close()
|
||||||
threadData.hashDBCursor.connection.close()
|
threadData.hashDBCursor.connection.close()
|
||||||
threadData.hashDBCursor = None
|
threadData.hashDBCursor = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user