From 991de05512eb6637f32e70e1a22bfa8c598a108c Mon Sep 17 00:00:00 2001 From: Solderpunk Date: Sun, 17 May 2020 14:02:36 +0200 Subject: [PATCH] Immediately commit all changes to the TOFU DB, so it gets unlocked and multiple clients can access it at once. --- av98.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/av98.py b/av98.py index 47317c8..ba304eb 100755 --- a/av98.py +++ b/av98.py @@ -668,6 +668,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""") SET last_seen=?, count=? WHERE hostname=? AND address=? AND fingerprint=?""", (now, count+1, host, address, fingerprint)) + self.db_conn.commit() break else: self._debug("TOFU: Unrecognised certificate {}! Raising the alarm...".format(fingerprint)) @@ -684,6 +685,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""") self.db_cur.execute("""INSERT INTO cert_cache VALUES (?, ?, ?, ?, ?, ?)""", (host, address, fingerprint, now, now, 1)) + self.db_conn.commit() else: raise Exception("TOFU Failure!") @@ -693,6 +695,7 @@ Slow internet connection? Use 'set timeout' to be more patient.""") self.db_cur.execute("""INSERT INTO cert_cache VALUES (?, ?, ?, ?, ?, ?)""", (host, address, fingerprint, now, now, 1)) + self.db_conn.commit() def _get_handler_cmd(self, mimetype): # Now look for a handler for this mimetype