diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2010-10-18 22:14:47 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2010-10-18 22:15:44 +0300 |
commit | bc8624b15d8055cdead310352e5943da18500d16 (patch) | |
tree | 35b075c486baa1770083d06dfca46dfe72c3bb06 /src | |
parent | 433c7a654556cc43b8f4e5c4c1b175480b266ba5 (diff) | |
download | postgresql-bc8624b15d8055cdead310352e5943da18500d16.tar.gz postgresql-bc8624b15d8055cdead310352e5943da18500d16.zip |
Support key word 'all' in host column of pg_hba.conf
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 9 | ||||
-rw-r--r-- | src/include/libpq/hba.h | 3 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 20c86b7ea3f..17363599626 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -885,8 +885,11 @@ parse_hba_line(List *line, int line_num, HbaLine *parsedline) } token = lfirst(line_item); - /* Is it equal to 'samehost' or 'samenet'? */ - if (strcmp(token, "samehost\n") == 0) + if (strcmp(token, "all\n") == 0) + { + parsedline->ip_cmp_method = ipCmpAll; + } + else if (strcmp(token, "samehost\n") == 0) { /* Any IP on this host is allowed to connect */ parsedline->ip_cmp_method = ipCmpSameHost; @@ -1503,6 +1506,8 @@ check_hba(hbaPort *port) continue; } break; + case ipCmpAll: + break; case ipCmpSameHost: case ipCmpSameNet: if (!check_same_host_or_net(&port->raddr, diff --git a/src/include/libpq/hba.h b/src/include/libpq/hba.h index eb6637f1c74..aa60d8d4f17 100644 --- a/src/include/libpq/hba.h +++ b/src/include/libpq/hba.h @@ -36,7 +36,8 @@ typedef enum IPCompareMethod { ipCmpMask, ipCmpSameHost, - ipCmpSameNet + ipCmpSameNet, + ipCmpAll } IPCompareMethod; typedef enum ConnType |