Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 24DA7B5DBC6 for ; Thu, 9 Jun 2011 21:42:18 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 95502-01 for ; Fri, 10 Jun 2011 00:42:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id 3BFE8B5D90E for ; Thu, 9 Jun 2011 21:42:10 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p5A0gAw27314; Thu, 9 Jun 2011 20:42:10 -0400 (EDT) From: Bruce Momjian Message-Id: <201106100042.p5A0gAw27314@momjian.us> Subject: Re: CIDR address in pg_hba.conf In-Reply-To: <8795.1307379385@sss.pgh.pa.us> To: Tom Lane Date: Thu, 9 Jun 2011 20:42:10 -0400 (EDT) CC: Fujii Masao , pgsql-docs X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201106/25 X-Sequence-Number: 6799 Tom Lane wrote: > Fujii Masao writes: > > http://developer.postgresql.org/pgdocs/postgres/auth-pg-hba-conf.html > >> An IP address is specified in standard dotted decimal notation with > >> a CIDR mask length. The mask length indicates the number of > >> high-order bits of the client IP address that must match. Bits to the > >> right of this must be zero in the given IP address. > > > Is the last statement correct? When I specified the following setting > > in pg_hba.conf, I could not find any problem in PostgreSQL. > > > host all all 192.168.1.99/24 trust > > > As far as I read the code, those bits seem not to need to be zero. > > Attached patch just removes that statement. > > Even if it happens to work that way at the moment, do we want to > encourage people to depend on such an implementation artifact? > > IOW, if you read "must" as "if you want to trust it to work in future > versions, you must", the advice is perfectly sound. Should we use "should"? > >> right of this should be zero in the given IP address. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +