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

Improvement #8353 : Report unique usernames for isc_info_user_names

This commit is contained in:
Vlad Khorsun 2024-12-19 00:21:20 +02:00
parent 33f5d0b263
commit 4119f62556

View File

@ -634,6 +634,8 @@ void INF_database_info(thread_db* tdbb,
}
{
StrArray names;
SyncLockGuard sync(&dbb->dbb_sync, SYNC_SHARED, "INF_database_info");
for (const Jrd::Attachment* att = dbb->dbb_attachments; att; att = att->att_next)
@ -644,6 +646,13 @@ void INF_database_info(thread_db* tdbb,
{
const char* userName = user->getUserName().hasData() ?
user->getUserName().c_str() : "(Firebird Worker Thread)";
FB_SIZE_T pos;
if (names.find(userName, pos))
continue;
names.insert(pos, userName);
p = buffer;
const ULONG len = MIN(strlen(userName), MAX_UCHAR);
*p++ = static_cast<UCHAR>(len);