mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 20:43:04 +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 int onShutdown(const int, const int, void*);
|
||||||
|
|
||||||
static SecurityDatabase instance;
|
public:
|
||||||
|
SecurityDatabase(Firebird::MemoryPool&)
|
||||||
SecurityDatabase()
|
|
||||||
: lookup_db(0), lookup_req(0), counter(0), server_shutdown(false)
|
: lookup_db(0), lookup_req(0), counter(0), server_shutdown(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -105,12 +105,12 @@ const UCHAR SecurityDatabase::TPB[4] =
|
|||||||
isc_tpb_wait
|
isc_tpb_wait
|
||||||
};
|
};
|
||||||
|
|
||||||
// Static instance of the database
|
|
||||||
|
|
||||||
SecurityDatabase SecurityDatabase::instance;
|
|
||||||
|
|
||||||
#ifndef EMBEDDED
|
#ifndef EMBEDDED
|
||||||
namespace {
|
namespace {
|
||||||
|
// Static instance of the database
|
||||||
|
|
||||||
|
GlobalPtr<SecurityDatabase> instance;
|
||||||
|
|
||||||
// Disable attempts to brute-force logins/passwords
|
// Disable attempts to brute-force logins/passwords
|
||||||
class FailedLogin
|
class FailedLogin
|
||||||
{
|
{
|
||||||
@ -397,12 +397,12 @@ void SecurityDatabase::prepare()
|
|||||||
|
|
||||||
void SecurityDatabase::initialize()
|
void SecurityDatabase::initialize()
|
||||||
{
|
{
|
||||||
instance.init();
|
instance->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SecurityDatabase::shutdown()
|
void SecurityDatabase::shutdown()
|
||||||
{
|
{
|
||||||
instance.fini();
|
instance->fini();
|
||||||
}
|
}
|
||||||
|
|
||||||
int SecurityDatabase::onShutdown(const int, const int, void* me)
|
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.
|
// that means the current context must be saved and restored.
|
||||||
|
|
||||||
TEXT pw1[MAX_PASSWORD_LENGTH + 1];
|
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;
|
pw1[MAX_PASSWORD_LENGTH] = 0;
|
||||||
string storedHash(pw1, MAX_PASSWORD_LENGTH);
|
string storedHash(pw1, MAX_PASSWORD_LENGTH);
|
||||||
storedHash.rtrim();
|
storedHash.rtrim();
|
||||||
|
Loading…
Reference in New Issue
Block a user