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

Let trace plugin show ROLE used when service attachment was established.

Format is the same as for database attachment: USER[:ROLE]
This commit is contained in:
hvlad 2020-06-21 12:51:51 +03:00
parent f9365d76af
commit dd241208f2
2 changed files with 15 additions and 3 deletions

View File

@ -627,7 +627,7 @@ const char* TraceServiceImpl::getUserName()
const char* TraceServiceImpl::getRoleName()
{
return NULL;
return m_svc->getRoleName().c_str();
}
const char* TraceServiceImpl::getCharSet()

View File

@ -1927,8 +1927,20 @@ void TracePluginImpl::register_service(ITraceServiceConnection* service)
remote_address = "internal";
}
if (username.isEmpty())
username = "<user is unknown>";
if (!username.isEmpty())
{
const char* role = service->getRoleName();
if (role && *role)
{
username.append(":");
username.append(role);
}
}
else
{
username = "<unknown_user>";
}
tmp = service->getRemoteProcessName();
if (tmp && *tmp) {