Stop crackmapexec from crashing completely when concurrency issues cause lock-contention on the database - in SMB-mode.

main
Gianfranco Alongi 2022-04-03 13:38:48 +02:00
parent e9bcd09bd2
commit 355b75e21f
1 changed files with 3 additions and 1 deletions

View File

@ -75,6 +75,8 @@ async def run_protocol(loop, protocol_obj, args, db, target, jitter):
except asyncio.CancelledError:
logging.debug("Stopping thread")
thread.cancel()
except sqlite3.OperationalError as e:
logging.debug("Sqlite error - sqlite3.operationalError - {}".format(str(e)))
async def start_threadpool(protocol_obj, args, db, targets, jitter):
pool = ThreadPoolExecutor(max_workers=args.threads + 1)
@ -261,4 +263,4 @@ def main():
module_server.shutdown()
if __name__ == '__main__':
main()
main()