Commit d3d54199 authored by Bruce Momjian's avatar Bruce Momjian

Cleanup of 'sameuser' patch.

parent 3f372ee6
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.31 1998/06/13 04:27:15 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.32 1998/06/13 05:14:55 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -210,8 +210,8 @@ process_hba_record(FILE *file, SockAddr *raddr, const char user[], ...@@ -210,8 +210,8 @@ process_hba_record(FILE *file, SockAddr *raddr, const char user[],
* sort of connection, ignore it. * sort of connection, ignore it.
*/ */
if ((strcmp(buf, database) != 0 && strcmp(buf, "all") != 0 && if ((strcmp(db, database) != 0 && strcmp(db, "all") != 0 &&
(strcmp(buf, "sameuser") != 0 || strcmp(user, database) != 0)) || (strcmp(db, "sameuser") != 0 || strcmp(database, user) != 0)) ||
raddr->sa.sa_family != AF_UNIX) raddr->sa.sa_family != AF_UNIX)
return; return;
} }
...@@ -270,8 +270,8 @@ process_hba_record(FILE *file, SockAddr *raddr, const char user[], ...@@ -270,8 +270,8 @@ process_hba_record(FILE *file, SockAddr *raddr, const char user[],
* sort of connection, ignore it. * sort of connection, ignore it.
*/ */
if ((strcmp(buf, database) != 0 && strcmp(buf, "all") != 0 && if ((strcmp(db, database) != 0 && strcmp(db, "all") != 0 &&
(strcmp(buf, "sameuser") != 0 || strcmp(user, database) != 0)) || (strcmp(db, "sameuser") != 0 || strcmp(database, user) != 0)) ||
raddr->sa.sa_family != AF_INET || raddr->sa.sa_family != AF_INET ||
((file_ip_addr.s_addr ^ raddr->in.sin_addr.s_addr) & mask.s_addr) != 0x0000) ((file_ip_addr.s_addr ^ raddr->in.sin_addr.s_addr) & mask.s_addr) != 0x0000)
return; return;
......
...@@ -128,4 +128,4 @@ ...@@ -128,4 +128,4 @@
# By default, allow anything over UNIX domain sockets and localhost. # By default, allow anything over UNIX domain sockets and localhost.
local all trust local all trust
host all 127.0.0.1 255.255.255.255 trust host all 127.0.0.1 255.255.255.255 trust
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment