Apparently the first commit (59ae429972)
did not include all files.
Furthermore the used script tended to produce funny results in certain
cases. This has been fixed and as a result thereof a few more changes
were made in this second run.
This option allows to set a threshold on how long a user's channel
should be remembered. This is useful for scenarios where users usually
don't want their channel to be remembered by the server unless they had
a disconnect (aka have ot re-connect after a short period of time).
Implements #4143
This option allows to set a threshold on how long a user's channel
should be remembered. This is useful for scenarios where users usually
don't want their channel to be remembered by the server unless they had
a disconnect (aka have ot re-connect after a short period of time).
Implements #4143
In #3803 it is reported that the server regularly crashes because the
MySQL/SQLite part of the database code for group changes doesn't handle
conflicts in primary keys (as the PostgreSQL part does).
This commit makes the SQL statement use REPLACE INTO instead of INSERT
INTO which according to the docs "REPLACE works exactly like INSERT,
except that if an old row in the table has the same value as a new row
for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the
new row is inserted."
It's actually a MySQL extension but according to Wikipedia SQLite
supports it as well.
In a scenario in which a database with an older structure version
already exists this would lead to the server re-generating all tables on
every start due to the version number not being updated in the process.
In #4213 it was reported that connecting to a server with a unicode
character (Emoji) in the name can crash the server (provided the user
name passes validation which is only possible if the server uses a
special rule for the username config) when using MySQL as the backend.
This is because we have been using "utf8" for MySQL which - as it turns
out - isn't actual utf8 (https://mathiasbynens.be/notes/mysql-utf8mb4).
Therefore this commit changes this behavior by setting the proper utf8
encoding for MySQL databases. For SQLite and PostgreSQL the encoding is
checked and if it is not utf8 (or utf16), the server will refuse to
start. This is because there is no way to set the encoding for existing
databases for these backends.
In #3803 it is reported that the server regularly crashes because the
MySQL/SQLite part of the database code for group changes doesn't handle
conflicts in primary keys (as the PostgreSQL part does).
This commit makes the SQL statement use REPLACE INTO instead of INSERT
INTO which according to the docs "REPLACE works exactly like INSERT,
except that if an old row in the table has the same value as a new row
for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the
new row is inserted."
It's actually a MySQL extension but according to Wikipedia SQLite
supports it as well.
This commit adds all the missing includes when the PCH header is not used.
Also, some includes are reordered and/or made consistent (e.g. "#include <QtEndian>" -> "#include <QtCore/QtEndian>").
According to Qt's documentation the PCH header doesn't need to be included.
From https://doc.qt.io/qt-5/qmake-precompiledheaders.html:
"To make your project use precompiled headers, you only need to define the PRECOMPILED_HEADER variable in your project file."
"qmake will handle the rest, to ensure the creation and use of the precompiled header file. You do not need to include the precompiled header file in HEADERS, as qmake will do this if the configuration supports precompiled headers."
Using SQLite's WAL (write-ahead log) can create less disk I/O while
still providing good consistency and durability.
This change uses SQLite's WAL with synchronous=NORMAL which can
cause loss of transactions on power failure. Only the transactions
which haven't been synced to the disk by the OS are lost. The
database itself will still be in a consistent state, but it might
not have all recent changes.
This replaces our ad-hoc password generator in ServerDB for generating
the initial SuperUser password.
The original implementation had several problems, including use of a
non-cryptographically secure random number generator, as well as problems
with modulo bias.
This commit fixes a potentially uninitialized variable ('id') in
Server::removeChannelDB().
GCC warning was:
ServerDB.cpp: In member function void Server::updateChannel(const Channel*):
ServerDB.cpp:1655: warning: id may be used uninitialized in this function
Used place holder marks for PostgreSQL UPSERT values instead of positional binding since the statements require the values twice (once for the INSERT, and once for the UPDATE should the insert fail).
The values to use for the ON CONFLICT DO UPDATE part of the UPSERT have been prefixed with u_ .
This commit reverts to using REPLACE INTO for non-PostgreSQL databases and uses the same code for them as the upstream master mumble-voip/mumble.
Previously this branch used the same code for all databases. This commit uses if statements to treat PostgreSQL differently from other databases where it needs to use UPSERT instead of REPLACE INTO.
Change users table to have new column format.
Change slog table to have a default value of "now()" for column msgtime as other databases use triggers to add this value.
Revert database logging statement so that the timestamp is assigned by triggers or column default values.
Password login was always allowed for SuperUser. -disablesu
removes SuperUser password. Certificate based authentication
is never allowed for SuperUser. In consequence SuperUser can
authenticate neither with password nor with certificate.
Set new password to allow login for SuperUser again.
* Adjusted to coding guidelines
* Pulled out PBKDF2 functionality into own class
* Make benchmark a best of N approach with guaranteed minimum
* Fixed broken database migration code. Don't try to alter
tables and instead rely on them being re-created with the
new fields.
* Fixed some typos in ini. Also move to the setting to the
end so ppl. don't get the idea they have to change this.
* Chose a scarier name for the plain hash function
* Use int instead of size_t for iteration counts as it is
the datatype used in the OpenSSL API. Otherwise we just
have to much pain with constantly converting and might
expose ourselves to size issues in the future.
* Moved new UserInfo enum entry to the end as to preserve
the order
Without this option (or when it's set to false), Murmur's default
authentication will kick in when your external authenticator plugin
crashes and basically allow *anyone* to login and register.
When it's enabled, Murmur will instead return a temporary login
failure to the client.
* The ice authenticator API was changed to allow returning -3 on auths,
the method comment of Server::authenticate now reflects this change as well.
** See 88d41e10, 6e8c8939
* The surrounding code already checks for the return value -3
(caller of method Server::msgAuthenticate)