firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Trace. Provide ability to see info about auth plugin which was used for login

Open pavel-zotov opened this issue 2 years ago • 1 comments

Create two users with same name but different auth plugins:

echo create user foo password '123' using plugin Legacy_UserManager; | isql /:employee
echo create user foo password '456' using plugin Srp; | isql /:employee

Run trace with 'log_connections = true'. Run then:

echo quit; | isql /:employee -user foo -pas 123
echo quit; | isql /:employee -user foo -pas 456

Trace will be like this:

2023-11-07T13:48:16.9750 (8872:00000000042D17C0) ATTACH_DATABASE
        employee (ATT_487, FOO:NONE, NONE, TCPv6:fe80::fcf1:e33c:e924:969d%8/59457)
        C:\FB\60SS\isql.exe:11696
... 
2023-11-07T13:48:23.6620 (8872:00000000042D17C0) ATTACH_DATABASE
        employee (ATT_490, FOO:NONE, NONE, TCPv6:fe80::fcf1:e33c:e924:969d%8/59460)
        C:\FB\60SS\isql.exe:12980
 ...

So, we have no info about what exact plugin was used for 1st and 2nd attachment. It could be shown like this:

employee (ATT_487, FOO:NONE:Legacy_UserManager, NONE, ...
employee (ATT_490, FOO:NONE:Srp, NONE, ...
...

(but only if there will be appropriate config parameter and it require this, e.g.: "log_auth_plugin = true")

pavel-zotov avatar Dec 03 '23 10:12 pavel-zotov

Is it actually possible? Adding a new function to TraceConnection will break both derived interfaces shifting pointers in pseudo-VMT.

aafemt avatar Dec 03 '23 10:12 aafemt