Execute initDbSession() on DB reconnects
authorMichael Marley <michael@michaelmarley.com>
Thu, 23 Apr 2015 12:46:43 +0000 (08:46 -0400)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 23 Apr 2015 20:02:30 +0000 (22:02 +0200)
commitea3c19c1baf6d042e2c2440631c0ce02432c96a0
tree0883dfe58dd42b279de9a36ba7551680ff72ab35
parent528493cd8b524c0978cb9ff4fbbe2fa74ad08847
Execute initDbSession() on DB reconnects

Previously, the initDbSession() function would only be run on the
initial connect.  Since the initDbSession() code in PostgreSQL is
used to fix the CVE-2013-4422 SQL Injection bug, this means that
Quassel was still vulnerable to that CVE if the PostgreSQL server
is restarted or the connection is lost at any point while Quassel
is running.

This bug also causes the Qt5 psql timezone fix to stop working
after a reconnect.

The fix is to disable Qt's automatic reconnecting, check the
connection status ourselves, and reconnect if necessary, executing
the initDbSession() function afterward.
src/core/abstractsqlstorage.cpp
src/core/abstractsqlstorage.h