mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 14:03:02 +01:00
Fixed unregistered bug (added by me at RC3 stage): wrong mutex when shutting down security database
This commit is contained in:
parent
5748bc216f
commit
8bdea51951
@ -111,9 +111,8 @@ private:
|
||||
|
||||
static int onShutdown(const int, const int, void*);
|
||||
|
||||
static SecurityDatabase instance;
|
||||
|
||||
SecurityDatabase()
|
||||
public:
|
||||
SecurityDatabase(Firebird::MemoryPool&)
|
||||
: lookup_db(0), lookup_req(0), counter(0), server_shutdown(false)
|
||||
{}
|
||||
|
||||
|
@ -105,12 +105,12 @@ const UCHAR SecurityDatabase::TPB[4] =
|
||||
isc_tpb_wait
|
||||
};
|
||||
|
||||
// Static instance of the database
|
||||
|
||||
SecurityDatabase SecurityDatabase::instance;
|
||||
|
||||
#ifndef EMBEDDED
|
||||
namespace {
|
||||
// Static instance of the database
|
||||
|
||||
GlobalPtr<SecurityDatabase> instance;
|
||||
|
||||
// Disable attempts to brute-force logins/passwords
|
||||
class FailedLogin
|
||||
{
|
||||
@ -397,12 +397,12 @@ void SecurityDatabase::prepare()
|
||||
|
||||
void SecurityDatabase::initialize()
|
||||
{
|
||||
instance.init();
|
||||
instance->init();
|
||||
}
|
||||
|
||||
void SecurityDatabase::shutdown()
|
||||
{
|
||||
instance.fini();
|
||||
instance->fini();
|
||||
}
|
||||
|
||||
int SecurityDatabase::onShutdown(const int, const int, void* me)
|
||||
@ -455,7 +455,7 @@ void SecurityDatabase::verifyUser(string& name,
|
||||
// that means the current context must be saved and restored.
|
||||
|
||||
TEXT pw1[MAX_PASSWORD_LENGTH + 1];
|
||||
const bool found = instance.lookupUser(name.c_str(), uid, gid, pw1);
|
||||
const bool found = instance->lookupUser(name.c_str(), uid, gid, pw1);
|
||||
pw1[MAX_PASSWORD_LENGTH] = 0;
|
||||
string storedHash(pw1, MAX_PASSWORD_LENGTH);
|
||||
storedHash.rtrim();
|
||||
|
Loading…
Reference in New Issue
Block a user