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)
* Implement copy constructors for classes with allocated memory.
** ServerDB gets a private not implemented copy constructor to effectively prevent copying, as it uses the static db field as a member.
* Fail hard on subsequent ServerDB instantiations
Returning a list of groups using an authenticator added
temporary group membership for the user id only. Those are
removed when we're disconnecting an old user using the same
user id. Adding the session id to the group should fix the
problem.
This won't work if someone uses verifyPassword to set the
permissions (which is an undocumented implementation detail
anyway).