Re: 7.4devel auth failed

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andreas Pflug <Andreas(dot)Pflug(at)web(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 7.4devel auth failed
Date: 2003-03-24 19:08:34
Message-ID: 200303241908.h2OJ8Y401740@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


That's strange. I just tested it here, and it worked. I have IPv6 code
enabled. but no IPv6 in my kernel, so there are just IPv4 connections.

Can you peek in this funciton and see where it is failing:

int
rangeSockAddrAF_INET(const SockAddr *addr, const SockAddr *netaddr,
const SockAddr *netmask)
{
if (addr->sa.sa_family != AF_INET ||
netaddr->sa.sa_family != AF_INET ||
netmask->sa.sa_family != AF_INET)
return 0;
if (((addr->in.sin_addr.s_addr ^ netaddr->in.sin_addr.s_addr) &
netmask->in.sin_addr.s_addr) == 0)
return 1;
else
return 0;
}

That is the IPv4 function.

---------------------------------------------------------------------------

Andreas Pflug wrote:
> Trying to connect from pgadmin2, I get the message
> "no pg_hba.conf entry for ..."
>
> I found that the ip address matching with rangeSockAdr in line 651 in
> hba.c fails.
>
> I get access if I set ipaddr/mask to 0.0.0.0/0.0.0.0 in pg_hba.conf.
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-03-24 19:12:53 Re: A bad behavior under autocommit off mode
Previous Message Tom Lane 2003-03-24 19:06:10 Re: A bad behavior under autocommit off mode