8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 20:03:02 +01:00

Fixed CORE-6227: isc_info_svc_user_dbpath always returns alias of main security database

This commit is contained in:
AlexPeshkoff 2020-01-14 17:10:48 +03:00
parent 96c59e6540
commit c6523020b1

View File

@ -1365,11 +1365,13 @@ ISC_STATUS Service::query2(thread_db* /*tdbb*/,
case isc_info_svc_user_dbpath:
if (svc_user_flag & SVC_user_dba)
{
// The path to the user security database (security2.fdb)
const RefPtr<const Config> defConf(Config::getDefaultConfig());
const char* secDb = defConf->getSecurityDatabase();
// The path to the user security database
PathName secDb;
RefPtr<const Config> config;
expandDatabaseName(svc_expected_db, secDb, &config);
expandDatabaseName(config->getSecurityDatabase(), secDb, nullptr);
if (!(info = INF_put_item(item, static_cast<USHORT>(strlen(secDb)), secDb, info, end)))
if (!(info = INF_put_item(item, static_cast<USHORT>(secDb.length()), secDb.c_str(), info, end)))
{
return 0;
}
@ -1817,11 +1819,13 @@ void Service::query(USHORT send_item_length,
case isc_info_svc_user_dbpath:
if (svc_user_flag & SVC_user_dba)
{
// The path to the user security database (security2.fdb)
const RefPtr<const Config> defConf(Config::getDefaultConfig());
const char* secDb = defConf->getSecurityDatabase();
// The path to the user security database
PathName secDb;
RefPtr<const Config> config;
expandDatabaseName(svc_expected_db, secDb, &config);
expandDatabaseName(config->getSecurityDatabase(), secDb, nullptr);
if (!(info = INF_put_item(item, static_cast<USHORT>(strlen(secDb)), secDb, info, end)))
if (!(info = INF_put_item(item, static_cast<USHORT>(secDb.length()), secDb.c_str(), info, end)))
{
return;
}