Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2013-03

FBAdmin

4 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mark Morgan Lloyd

I've added a call to FBAdmin to what I'm working on, to get the full description of the server (i.e. comparable to PostgreSQL's version() function). Thanks Ludo :-)

Is it possible to piggyback this onto an open Firebird connection, in case somebody interposes some sort of connection pooling layer?

Is there any way of determining what port the client is using for an open connection (i.e. not the 3050 at the server end)? Postgres implements this with inet_client_port(), and I'm considering a situation where the port numbers could be used as a low-security authenticator for backchannel commands (e.g. so that a server could tell a client to choke work it's relaying for one particular user who's hogging bandwidth).

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]
Ludo Brands
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 7 lines
I've added a call to FBAdmin to what I'm working on, to get the full description of the server (i.e. comparable to PostgreSQL's version() function). Thanks Ludo :-) Is it possible to piggyback this onto an open Firebird connection, in case somebody interposes some sort of connection pooling layer?

In trunk you'll find TSQLConnection.GetConnectionInfo that was added for this purpose. Use one of the TConnInfoType enums to get server or client info.

Show quoted text 7 lines
Is there any way of determining what port the client is using for an open connection (i.e. not the 3050 at the server end)? Postgres implements this with inet_client_port(), and I'm considering a situation where the port numbers could be used as a low-security authenticator for backchannel commands (e.g. so that a server could tell a client to choke work it's relaying for one particular user who's hogging bandwidth).

inet_client_port is an SQL function used for example to log the client connection. It is only valid for the current connection. I'm not aware of anything similar in Firebird. Interbase 7+ has the TMP$ATTACHMENTS table that has info on all connections but afaik Firebird doesn't have this yet.

Ludo

Reinier Olislagers
to Ludo Brands
Ludo Brands wrote 15 lines
On 03/24/2013 10:54 AM, Mark Morgan Lloyd wrote: > Is there any way of determining what port the client is using for an > open connection (i.e. not the 3050 at the server end)? Postgres > implements this with inet_client_port(), and I'm considering a situation > where the port numbers could be used as a low-security authenticator for > backchannel commands (e.g. so that a server could tell a client to choke > work it's relaying for one particular user who's hogging bandwidth). > inet_client_port is an SQL function used for example to log the client connection. It is only valid for the current connection. I'm not aware of anything similar in Firebird. Interbase 7+ has the TMP$ATTACHMENTS table that has info on all connections but afaik Firebird doesn't have this yet.

For Firebird, look at the MON$ATTACHMENT table, e.g. select * from MON$ATTACHMENTS where MON$ATTACHMENT_ID = CURRENT_CONNECTION

(or of course, all connections). At least client IP address is shown.

Mark Morgan Lloyd
to Ludo Brands: In trunk you'll find TSQLConnection.GetConnectionInfo that was added for this purpose.…
Ludo Brands wrote 12 lines
On 03/24/2013 10:54 AM, Mark Morgan Lloyd wrote: > I've added a call to FBAdmin to what I'm working on, to get the full > description of the server (i.e. comparable to PostgreSQL's version() > function). Thanks Ludo :-) > > Is it possible to piggyback this onto an open Firebird connection, in > case somebody interposes some sort of connection pooling layer? > In trunk you'll find TSQLConnection.GetConnectionInfo that was added for this purpose. Use one of the TConnInfoType enums to get server or client info.

Thanks Ludo, I'll version conditionals what will that be- 2.6.6?

Show quoted text 13 lines
> Is there any way of determining what port the client is using for an > open connection (i.e. not the 3050 at the server end)? Postgres > implements this with inet_client_port(), and I'm considering a situation > where the port numbers could be used as a low-security authenticator for > backchannel commands (e.g. so that a server could tell a client to choke > work it's relaying for one particular user who's hogging bandwidth). > inet_client_port is an SQL function used for example to log the client connection. It is only valid for the current connection. I'm not aware of anything similar in Firebird. Interbase 7+ has the TMP$ATTACHMENTS table that has info on all connections but afaik Firebird doesn't have this yet.

Thanks, noted that for the future and noted also Reinier's mention of MON$ATTACHMENT: I see that this gives the server pid which might be a better bit of "shared knowledge" since it would be marginally more difficult to sniff.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]