Re: CIDR in pg_hba.conf

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Larry Rosenman <ler(at)lerctr(dot)org>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CIDR in pg_hba.conf
Date: 2003-05-07 16:29:19
Message-ID: 27808.1052324959@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Larry Rosenman <ler(at)lerctr(dot)org> writes:
> --On Wednesday, May 07, 2003 09:50:55 -0400 Andrew Dunstan
>> So in hba.c, if we found a / in the IP address, we wouldn't go looking
>> for a separate netmask field.

> Please do this !

It works for me. One thought though: someday someone might want to get
around to allowing a DNS name in the host field, too. Can we define a
test that handles all three cases? Perhaps do this:

* If IP address contains only 0-9 and dot (easily coded with strspn()),
then it's old-style IP address; expect netmask as next field.

* If IP address contains only 0-9, dot, and slash, then it's CIDR;
there's no separate netmask field.

* Otherwise IP address is a DNS name; there's no separate netmask.
(This case can error out for now, unless you're feeling ambitious.)

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message D'Arcy J.M. Cain 2003-05-07 17:16:21 Re: CIDR in pg_hba.conf
Previous Message Tom Lane 2003-05-07 16:08:42 Binary data representations for new protocol