Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fe03a5f

Browse files
committed
Check if the role exists before doing more complex ident and Kerberos
authentication checks in the backend. Gavin Sherry
1 parent b227448 commit fe03a5f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/backend/libpq/auth.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.147 2007/01/05 22:19:29 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/libpq/auth.c,v 1.148 2007/02/08 04:52:18 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -216,6 +216,9 @@ pg_krb5_recvauth(Port *port)
216216
krb5_ticket *ticket;
217217
char *kusername;
218218

219+
if (get_role_line(port->user_name) == NULL)
220+
return STATUS_ERROR;
221+
219222
ret = pg_krb5_init();
220223
if (ret != STATUS_OK)
221224
return ret;

src/backend/libpq/hba.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.158 2007/01/05 22:19:29 momjian Exp $
13+
* $PostgreSQL: pgsql/src/backend/libpq/hba.c,v 1.159 2007/02/08 04:52:18 momjian Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1589,6 +1589,9 @@ authident(hbaPort *port)
15891589
{
15901590
char ident_user[IDENT_USERNAME_MAX + 1];
15911591

1592+
if (get_role_line(port->user_name) == NULL)
1593+
return STATUS_ERROR;
1594+
15921595
switch (port->raddr.addr.ss_family)
15931596
{
15941597
case AF_INET:

0 commit comments

Comments
 (0)