BUG #6110: pg_hba.conf samehost does not work
BUG #6110: pg_hba.conf samehost does not work
От:
"Binod Nepal" <nepalbinod@yahoo.com>
Дата:
The following bug has been logged online: Bug reference: 6110 Logged by: Binod Nepal Email address: nepalbinod@yahoo.com PostgreSQL version: 9.0.2 Operating system: Windows 7 Ultimate 32/64 Description: pg_hba.conf samehost does not work Details: pg_hba.conf # IPv4 local connections: host all all 127.0.0.1/32 md5 host all all samehost md5 host all all samenet md5 # IPv6 local connections: host all all ::1/128 md5 host all all samehost md5 host all all samenet md5 postgresql.conf listen_addresses = '*' SYSTEM DETAILS Operating System Windows 7 Ultimate 32 or 64 bit Computer Name SERVER PostgreSQL Server Version PostgreSQL 9.0.2 BUG DESCRIPTION I am using pgAdminIII, trying create a "New Server Registration". When I connect to (localhost), it works fine. But when I change the host to the actual workstation name, it says: FATAL: no pg_hba.conf entry for host "fe80::c81c:9e9c:6570:d0bf%20", user "postgres", database "postgres", SSL off even when I have host all all samehost md5 on pg_hba.conf on IPv4 and IPv6 settings. PLEASE NOTE I am trying to connect to the server from the same machine. ADDITIONAL INFORMATION If I connect to "SERVER" from other computers on the same network, it works. For further information, please contact.
Re: BUG #6110: pg_hba.conf samehost does not work
От:
Robert Haas <robertmhaas@gmail.com>
Дата:
On Mon, Jul 11, 2011 at 5:13 AM, Binod Nepal wrote:
> # IPv4 local connections:
> host =A0 =A0all =A0 =A0 =A0 =A0 =A0 =A0 all =A0 =A0 =A0 =A0 =A0 =A0 127.0=
.0.1/32 =A0 =A0 =A0 =A0 =A0 =A0md5
> host =A0 =A0all =A0 =A0 =A0 =A0 =A0 =A0 all =A0 =A0 =A0 =A0 =A0 =A0 sameh=
ost =A0 =A0 =A0 =A0 =A0 =A0md5
> host =A0 =A0all =A0 =A0 =A0 =A0 =A0 =A0 all =A0 =A0 =A0 =A0 =A0 =A0 samen=
et =A0 =A0 =A0 =A0 =A0 =A0md5
> # IPv6 local connections:
> host =A0 =A0all =A0 =A0 =A0 =A0 =A0 =A0 all =A0 =A0 =A0 =A0 =A0 =A0 ::1/1=
28 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 md5
> host =A0 =A0all =A0 =A0 =A0 =A0 =A0 =A0 all =A0 =A0 =A0 =A0 =A0 =A0 sameh=
ost =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0md5
> host =A0 =A0all =A0 =A0 =A0 =A0 =A0 =A0 all =A0 =A0 =A0 =A0 =A0 =A0 samen=
et =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0md5
I don't think it accomplishes anything at all to have the same lines
in there twice. The comment doesn't affect whether the line applies
to IPv4 or IPv6.
ISTM the problem here must be the Windows version of
pg_foreach_ifaddr(), which uses this method to try to get a list of
addresses:
WSAIoctl(sock, SIO_GET_INTERFACE_LIST, 0, 0,
ii, n_ii * sizeof(INTERFACE_INFO),
&length, 0, 0)
Perhaps there's a better method we could be using, but I have no idea
what it is. A quick Google search didn't turn up any IPv6-related
restrictions on SIO_GET_INTERFACE_LIST.
--=20
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company