krb5 & multiple users

From: Ed Schaller <schallee+postgres(at)darkmist(dot)net>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: krb5 & multiple users
Date: 2002-05-20 13:13:17
Message-ID: 20020520131317.GC12126@darkmist.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

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. After changing to a different
user, all authentications fail since it is trying to use the previous
credentials.

Looking at the source code, I figured I could just move the the static
vars to the PGconn structure. As I did it turned out that the conn
structure was not available where it was needed, so I thought I would
post here for suggestions.

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.

Does anyone have any suggestions on this? It would probably be good to
integrate this fix into the next version.

thanks

>>>------>

--

+-------------+-----------------------+---------------+
| Ed Schaller | schallee(at)darkmist(dot)net | mistymushroom |
+-------------+-----------------------+---------------+

----- End forwarded message -----

>>>------>

--

+-------------+-----------------------+---------------+
| Ed Schaller | schallee(at)darkmist(dot)net | mistymushroom |
+-------------+-----------------------+---------------+

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2002-05-20 14:37:53 Re: krb5 & multiple users
Previous Message Gareth Kirwan 2002-05-20 11:53:01 Interval to number