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)
585585if (* error_p )
586586gotohba_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 */
591589if (port -> auth_method == uaKrb4 ||
592590port -> auth_method == uaKrb5 )
593591gotohba_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 ))
596595return ;
597596}
598597else if (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+ #ifdef HAVE_UNIX_SOCKETS
1351+
13511352static bool
13521353ident_unix (int sock ,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)
15151517if (!ident_inet (port -> raddr ,port -> laddr ,ident_user ))
15161518return STATUS_ERROR ;
15171519break ;
1520+
1521+ #ifdef HAVE_UNIX_SOCKETS
15181522case AF_UNIX :
15191523if (!ident_unix (port -> sock ,ident_user ))
15201524return STATUS_ERROR ;
15211525break ;
1526+ #endif
1527+
15221528default :
15231529return STATUS_ERROR ;
15241530}