mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Back out V6 code, caused postmaster startup failure.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.89 2002/12/06 03:46:26 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.90 2002/12/06 04:37:02 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -582,8 +582,9 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
|
||||
}
|
||||
else if (strcmp(token, "host") == 0 || strcmp(token, "hostssl") == 0)
|
||||
{
|
||||
SockAddr file_ip_addr, mask;
|
||||
|
||||
struct in_addr file_ip_addr,
|
||||
mask;
|
||||
|
||||
if (strcmp(token, "hostssl") == 0)
|
||||
{
|
||||
#ifdef USE_SSL
|
||||
@@ -618,25 +619,16 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
|
||||
if (!line)
|
||||
goto hba_syntax;
|
||||
token = lfirst(line);
|
||||
|
||||
if(SockAddr_pton(&file_ip_addr, token, strlen(token)) < 0){
|
||||
goto hba_syntax;
|
||||
}
|
||||
if (!inet_aton(token, &file_ip_addr))
|
||||
goto hba_syntax;
|
||||
|
||||
/* Read the mask field. */
|
||||
line = lnext(line);
|
||||
if (!line)
|
||||
goto hba_syntax;
|
||||
token = lfirst(line);
|
||||
|
||||
if(SockAddr_pton(&mask, token, strlen(token)) < 0){
|
||||
goto hba_syntax;
|
||||
}
|
||||
|
||||
|
||||
if(file_ip_addr.sa.sa_family != mask.sa.sa_family){
|
||||
goto hba_syntax;
|
||||
}
|
||||
if (!inet_aton(token, &mask))
|
||||
goto hba_syntax;
|
||||
|
||||
/* Read the rest of the line. */
|
||||
line = lnext(line);
|
||||
@@ -647,7 +639,8 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
|
||||
goto hba_syntax;
|
||||
|
||||
/* Must meet network restrictions */
|
||||
if (!isAF_INETx(&port->raddr) || !rangeSockAddr(&port->raddr, &file_ip_addr, &mask))
|
||||
if (port->raddr.sa.sa_family != AF_INET ||
|
||||
((file_ip_addr.s_addr ^ port->raddr.in.sin_addr.s_addr) & mask.s_addr) != 0)
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user