Re: Kerberos as source of user name? (Re: [BUGS] segfault in psql on x86_64)

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Kerberos as source of user name? (Re: [BUGS] segfault in psql on x86_64)
Date: 2004-02-08 17:14:36
Message-ID: 87ad3tpk77.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Orion Henry <orion(at)trustcommerce(dot)com> writes:
> > It appears to be faulting on a kerberos call which is odd because I
> > don't use kerberos for anything.
>
> I was a bit surprised to realize that if you compile Kerberos support at
> all, libpq will try to get a user name from Kerberos in preference to
> using getpwuid(). This strikes me as odd and surprising behavior.
> There's certainly no security reason for it, since we are only getting
> a default user name that can be trivially overridden.

Harumph. I reported this about a year ago:

http://archives.postgresql.org/pgsql-general/2002-12/msg00740.php

I'm not sure it can be fixed by just not setting the default username though.

In fact I think there's something a little backwards about deciding on a
default username in advance and then trying various authentication methods.

In my case I have a kerberos principal gsstark(at)ATHENA(dot)MIT(dot)EDU and a local
username of "stark".

It seems like it should try to do the kerberos authentication as username
"gsstark" (or even "gsstark(at)ATHENA(dot)MIT(dot)EDU" since the realm is significant).
And if that fails, then it should try to log in as "stark" using unix userid
authentication.

The only fear I have with that direction is that it makes things a bit
unpredictable. I could see it being weird having scripts randomly fail because
they logged in as the wrong user if the tickets happened to have expired or
the network goes down.

--
greg

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2004-02-08 18:54:26 Re: Kerberos as source of user name? (Re: [BUGS] segfault in psql on x86_64)
Previous Message ezra epstein 2004-02-08 02:36:09 BUG? server closed the connection unexpectedly 7.4 on Windows (cygwin)

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2004-02-08 17:33:40 session persistent data for plperl
Previous Message Peter Eisentraut 2004-02-08 12:02:30 Re: RFC: Security documentation