Skip to content

Commit a11ea5e

Browse files
committed
Don't use gethostbyname2(). It's not portable and we don't claim to
support IPv6 anyway.
1 parent 1e91782 commit a11ea5e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/interfaces/libpq/fe-secure.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v 1.11 2002/09/04 20:31:47 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-secure.c,v 1.12 2002/09/05 18:27:13 petere Exp $
1515
*
1616
* NOTES
1717
* The client *requires* a valid server certificate. Since
@@ -364,7 +364,7 @@ verify_cb(int ok, X509_STORE_CTX *ctx)
364364

365365
/*
366366
* Verify that common name resolves to peer.
367-
* This function is not thread-safe due to gethostbyname2().
367+
* This function is not thread-safe due to gethostbyname().
368368
*/
369369
static int
370370
verify_peer(PGconn *conn)
@@ -391,7 +391,7 @@ verify_peer(PGconn *conn)
391391
return 0;
392392

393393
/* what do we know about the peer's common name? */
394-
if ((h = gethostbyname2(conn->peer_cn, addr.sa_family)) == NULL)
394+
if ((h = gethostbyname(conn->peer_cn)) == NULL)
395395
{
396396
printfPQExpBuffer(&conn->errorMessage,
397397
libpq_gettext("error getting information about host (%s): %s\n"),

0 commit comments

Comments
 (0)