This commit is contained in:
Miroslav Stampar 2022-12-17 14:46:00 +01:00
parent a11f79e16f
commit b7411211af
2 changed files with 16 additions and 11 deletions

View File

@ -20,7 +20,7 @@ from thirdparty import six
from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.6.12.5"
VERSION = "1.6.12.6"
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)

View File

@ -17,6 +17,7 @@ import socket
import sqlite3
import sys
import tempfile
import threading
import time
from lib.core.common import dataToStdout
@ -88,6 +89,7 @@ class Database(object):
def connect(self, who="server"):
self.connection = sqlite3.connect(self.database, timeout=3, isolation_level=None, check_same_thread=False)
self.cursor = self.connection.cursor()
self.lock = threading.Lock()
logger.debug("REST-JSON API %s connected to IPC database" % who)
def disconnect(self):
@ -101,6 +103,7 @@ class Database(object):
self.connection.commit()
def execute(self, statement, arguments=None):
with self.lock:
while True:
try:
if arguments:
@ -110,6 +113,8 @@ class Database(object):
except sqlite3.OperationalError as ex:
if "locked" not in getSafeExString(ex):
raise
else:
time.sleep(1)
else:
break