Re: Massively annoying bug still not fixed in v1.20 :-( - Mailing list pgadmin-support
From | Craig Ringer |
---|---|
Subject | Re: Massively annoying bug still not fixed in v1.20 :-( |
Date | |
Msg-id | CAMsr+YFgPA690RZhutwaPdH2PTVJCva_0V1hVUHbLBzo=P3P_w@mail.gmail.com Whole thread Raw |
In response to | Re: Massively annoying bug still not fixed in v1.20 :-( (Magnus Hagander <magnus@hagander.net>) |
List | pgadmin-support |
On Dec 19, 2014 5:02 PM, "Craig Ringer" <craig@2ndquadrant.com> wrote:
>
> On 12/19/2014 11:57 PM, Dave Page wrote:
> > Right - we'd have to store the entries somewhere based on the target
> > server and the SSH config, and dynamically rebuilt the pgpass file
> > during the connection process. That seems a) ugly and b) very fragile.
>
> Darn. I thought libpq had a callback for a password prompt, but it doesn't.
>
> Guess we should add that. If libpq gets an auth request from the server
> and has no password from the connection string, it should invoke a
> callback (if supplied) that lets the client supply a password dynamically.
>We definitely should. And we should make sure we design it not to just support passwords but anything we might need to unlock an authentication - say a x509 certificate (doesn't have to be the same function, but it should be part of the design considerations for the feature).
/Magnus
It might also want the PQconninfoOption array, but it can get that from PQconninfo(PGconn*).
It's unfortunately necessary to consider that on certain platforms (ahem Windows ahem) the callback function might be running in a module linked to a different C library - so it's not safe to free() memory within libpq that was malloc()'d within the callback. We can solve that by exposing a PQmalloc(...) and declaring that memory allocated as a callback result must use that function. We already have PQfreemem(...) for the opposite direction so that seems to be the way to go, calling it PQallocmem(...) .
PostgreSQL Development, 24x7 Support, Training & Services
pgadmin-support by date: