From: Manuel Nickschas Date: Tue, 21 Sep 2010 06:46:55 +0000 (+0200) Subject: Properly reject invalid handshake data X-Git-Tag: 0.6.3~2 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=6e02e38993d9b2d3c5e36359dcb6f6969e4caf39 Properly reject invalid handshake data Currently, if a client attempts to configure a core's storage backend even though it is already configured, the core will ignore the attempt silently (e.g. the existing storage backends will simply drop the request, but the client also won't receive an error message). This can never happen unless you use an alternative client with a buggy handshake sequence though, since quasselclient checks if the core is already configured beforehand. Nonetheless, it makes sense to properly error out from the core side, just in case we're getting new storage backends in the future that don't properly check this, or alternative clients which might be confused by not receiving an error when they should. Thanks to JodaZ for pointing this out. --- diff --git a/src/core/core.cpp b/src/core/core.cpp index 378e3a46..f9b08dfa 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -272,8 +272,7 @@ QString Core::setupCore(QVariantMap setupData) { if(user.isEmpty() || password.isEmpty()) { return tr("Admin user or password not set."); } - _configured = initStorage(setupData, true); - if(!_configured) { + if(_configured || !(_configured = initStorage(setupData, true))) { return tr("Could not setup storage!"); } CoreSettings s;