Re: pg_hba.conf confusion

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "David M(dot) Kaplan" <dmkaplan(at)ucdavis(dot)edu>
Cc: Reinhard Max <max(at)suse(dot)de>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: pg_hba.conf confusion
Date: 2002-06-21 20:11:30
Message-ID: 200206212011.g5LKBUP14924@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David M. Kaplan wrote:
> Thanks, that did fix that problem. Now I have another one. The line:
>
> host all 192.168.1.2 255.255.255.128 password
>
> matches all ip addresses of the form 192.168.1.x. If I change the mask
> to 255.255.255.255 it no longer matches all addresses. Although this
> fixes the problem, it seems strange to me that it works this way.
> Basically, if mask is something other than 255.255.255.255, you might
> as well put 0's in your id address. This doesnt seem to be how subnet
> masks normally work and it seems redundant to me.
>
> Is there something I don't understand?

A netmask of 255.255.255.128 means ignore the bottom seven bits of the
address. You are right they may as well be zero so in the case above
192.168.1.2 and 192.168.1.0 would behave the same. Is there something
else you wanted it to do?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-06-21 20:55:27 Re: INITDB hanging on Win2000/CygWin (PGSQL 7.2.1).
Previous Message Tom Lane 2002-06-21 19:32:30 Re: I have problem with pg_dump in PostgreSQL 7.1.2