pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Stephen Frost <sfrost@snowman.net>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Christopher Head <chris2k01@hotmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #5559: Full SSL verification fails when hostaddr provided
Date: Wed, 14 Jul 2010 17:58:04 -0400
Message-ID: <18779.1279144684@sss.pgh.pa.us> (raw)
In-Reply-To: <20100714214403.GQ21875@tamriel.snowman.net>
References: <18252.1279058967@sss.pgh.pa.us>
	<AANLkTikEU91MMvOXTrXkf7TGF8KZPRoBNh7csEeSy6ag@mail.gmail.com>
	<6811.1279123338@sss.pgh.pa.us>
	<7342.1279124972@sss.pgh.pa.us>
	<20100714173942.GM21875@tamriel.snowman.net>
	<9371.1279130114@sss.pgh.pa.us>
	<20100714183240.GO21875@tamriel.snowman.net>
	<10950.1279135209@sss.pgh.pa.us>
	<20100714212805.GP21875@tamriel.snowman.net>
	<18347.1279143321@sss.pgh.pa.us>
	<20100714214403.GQ21875@tamriel.snowman.net>

Stephen Frost <sfrost@snowman.net> writes:
> * Tom Lane (tgl@sss.pgh.pa.us) wrote:
>> Uh, no, because hostaddr is (required to be) a numeric IP.  The odds of
>> it being useful in this context seem negligible.

> Err, no, it'll work just fine- gethostbyname() will take the dotted-quad
> numeric IP and return the hostname and Kerberos will use that to generate
> the principal.

Hm.  That might happen to work for Kerberos, but it won't work for
GSSAPI or SSPI --- in both those code paths we just push the host name
literally into a constructed principal string.  Not sure if we really
want Kerberos to work differently from the more modern alternatives.

> Maybe I'm missing something, but hostaddr being an IP is
> just like if you passed in host with an IP,

No, it's entirely different.  The point of hostaddr is to avoid doing a
forward DNS lookup inside PQconnect() when you would rather it be done
at some other time.  It's not to substitute for actually knowing the
host name.  I expect that typical applications making use of it would
essentially cache the hostaddr corresponding to host name and would be
able to pass both to libpq.  The option to supply only hostaddr is just
there for cases where you truly don't need to know the host name, which
clearly does *not* include Kerberos auth.

The case you're describing could perfectly well be handled by passing
host as a numeric IP string, without using hostaddr; so I don't think
we are losing any functionality.

> I don't believe anything is going to avoid an rDNS lookup except bombing
> out before invoking krb5_sname_to_principal().

So it would seem.  The bottom line is that if you don't want any DNS
activity to happen during PQconnect(), you can't use Kerberos auth.
What we allow or don't allow won't change that.

			regards, tom lane



view thread (26+ messages)  latest in thread

Message-ID: <18779.1279144684@sss.pgh.pa.us>
Permalink:  ../18779.1279144684@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18779.1279144684@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sfrost@snowman.net, magnus@hagander.net, chris2k01@hotmail.com
  Subject: Re: BUG #5559: Full SSL verification fails when hostaddr provided
  In-Reply-To: <18779.1279144684@sss.pgh.pa.us>
  References: <18252.1279058967@sss.pgh.pa.us> <AANLkTikEU91MMvOXTrXkf7TGF8KZPRoBNh7csEeSy6ag@mail.gmail.com> <6811.1279123338@sss.pgh.pa.us> <7342.1279124972@sss.pgh.pa.us> <20100714173942.GM21875@tamriel.snowman.net> <9371.1279130114@sss.pgh.pa.us> <20100714183240.GO21875@tamriel.snowman.net> <10950.1279135209@sss.pgh.pa.us> <20100714212805.GP21875@tamriel.snowman.net> <18347.1279143321@sss.pgh.pa.us> <20100714214403.GQ21875@tamriel.snowman.net> <18779.1279144684@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox