Re: krb5 & multiple users

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ed Schaller <schallee+postgres(at)darkmist(dot)net>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: krb5 & multiple users
Date: 2002-05-20 14:37:53
Message-ID: 22439.1021905473@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Ed Schaller <schallee+postgres(at)darkmist(dot)net> writes:
> I am trying to connect to the database multiple times with different
> user accounts using kerberos. Unfortunately the current libpq libraries
> keep all of the kerberos credentials and such in static variables that
> are used for all subsequent connections.

Ugh.

> The options I am looking at are:

> Add it to the PGconn structure and pull it in where it is needed. This
> would require some api changes.

> Keep a hash of the usernames in static space and use the right
> credentials for the right user. This would fix the problem, but it would
> require extra data structures that aren't integrated into the rest of
> the library.

> The third option is to just not save credentials at all, but load them
> each time for each connection or new connection. This would probably be
> the simplest, but will require a little more file io and such.

I'm a bit confused here --- are the credentials used at all after
connection setup? If not, your third option seems good.

I'd still say that it sucks to be using static variables at all, even
during connection setup, since that will fail if someone tries to launch
two new connections concurrently. So the best bet would be to move the
variables into PGconn, even if they're not needed after startup.

I don't understand your statement that this'll require API changes.
PGconn is not an exported data structure.

regards, tom lane

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ed Schaller 2002-05-20 15:51:17 Re: krb5 & multiple users
Previous Message Ed Schaller 2002-05-20 13:13:17 krb5 & multiple users