Re: ident auth postgres 7.4 fedora core 3 - Mailing list pgsql-jdbc

From Ian Pilcher
Subject Re: ident auth postgres 7.4 fedora core 3
Date
Msg-id d0hrsu$q0u$1@sea.gmane.org
Whole thread Raw
In response to ident auth postgres 7.4 fedora core 3  (Todd Gee <toddgee@yahoo.com>)
Responses Re: ident auth postgres 7.4 fedora core 3  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: ident auth postgres 7.4 fedora core 3  (Vadim Nasardinov <vadimn@redhat.com>)
Re: ident auth postgres 7.4 fedora core 3  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: ident auth postgres 7.4 fedora core 3  (Ian Pilcher <i.pilcher@comcast.net>)
List pgsql-jdbc
Todd Gee wrote:
> So I just upgraded my RH 9 box to Fedora Core 3 and ident auth
> stopped working.  I've been thru the ident authorization process
> before and have become pretty conversant w/ it, but this issue is
> really strange.  It seems that ident auth is only failing w/ JDBC
> connections.

Since 1.4.2 (I believe), Java uses IPv6 by default.  When a connection
is made to an IPv4 address, it actually makes an IPv6 connection to an
"IPv4-mapped address".  So when you request a connection to 127.0.0.1,
you actually get a connection to ::ffff:127.0.0.1.  PostgreSQL doesn't
know this, however; it asks the ident daemon, "who's connecting from
127.0.0.1?"  The daemon answers "nobody".

I got so frustrated looking for an ident daemon that handles this
situation properly, that I decided to write my own.  It's coming along,
but it's not functional yet.

In the meantime, the easiest approach is probably to tell Java to use
IPv4.  You can do this by setting the java.net.preferIPv4Stack system
property to false.  You may find this page helpful:

     http://java.sun.com/j2se/1.4.2/docs/guide/net/ipv6_guide/

--
========================================================================
Ian Pilcher                                        i.pilcher@comcast.net
========================================================================

pgsql-jdbc by date:

Previous
From: Markus Schaber
Date:
Subject: Re: impossible to update rows specifying columns with NULL
Next
From: Vadim Nasardinov
Date:
Subject: Re: ident auth postgres 7.4 fedora core 3