Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3b7c5aa

Browse files
committed
Fix some unprotected references to AF_UNIX ... wouldn't compile on
platforms without AF_UNIX sockets.
1 parente490ee8 commit3b7c5aa

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎src/backend/libpq/hba.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.108 2003/07/26 13:50:02 momjian Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/libpq/hba.c,v 1.109 2003/08/01 23:24:28 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -585,14 +585,13 @@ parse_hba(List *line, hbaPort *port, bool *found_p, bool *error_p)
585585
if (*error_p)
586586
gotohba_syntax;
587587

588-
/*
589-
* Disallow auth methods that always need AF_INET sockets to work.
590-
*/
588+
/* Disallow auth methods that always need TCP/IP sockets to work */
591589
if (port->auth_method==uaKrb4||
592590
port->auth_method==uaKrb5)
593591
gotohba_syntax;
594592

595-
if (port->raddr.addr.ss_family!=AF_UNIX)
593+
/* Does not match if connection isn't AF_UNIX */
594+
if (!IS_AF_UNIX(port->raddr.addr.ss_family))
596595
return;
597596
}
598597
elseif (strcmp(token,"host")==0
@@ -1348,6 +1347,8 @@ ident_inet(const SockAddr remote_addr,
13481347
*Returns either true and the username put into "ident_user",
13491348
*or false if we were unable to determine the username.
13501349
*/
1350+
#ifdefHAVE_UNIX_SOCKETS
1351+
13511352
staticbool
13521353
ident_unix(intsock,char*ident_user)
13531354
{
@@ -1491,6 +1492,7 @@ ident_unix(int sock, char *ident_user)
14911492
#endif
14921493
}
14931494

1495+
#endif/* HAVE_UNIX_SOCKETS */
14941496

14951497

14961498
/*
@@ -1515,10 +1517,14 @@ authident(hbaPort *port)
15151517
if (!ident_inet(port->raddr,port->laddr,ident_user))
15161518
returnSTATUS_ERROR;
15171519
break;
1520+
1521+
#ifdefHAVE_UNIX_SOCKETS
15181522
caseAF_UNIX:
15191523
if (!ident_unix(port->sock,ident_user))
15201524
returnSTATUS_ERROR;
15211525
break;
1526+
#endif
1527+
15221528
default:
15231529
returnSTATUS_ERROR;
15241530
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp