postgresql/src/interfaces/libpq
Tom Lane 8d00858baf Change libpq's internal uses of PQhost() to inspect host field directly.
Commit 1944cdc98 changed PQhost() to return the hostaddr value when that
is specified and host isn't.  This is a good idea in general, but
fe-auth.c and related files contain PQhost() calls for which it isn't.
Specifically, when we compare SSL certificates or other server identity
information to the host field, we do not want to use hostaddr instead;
that's not what's documented, that's not what happened pre-v10, and
it doesn't seem like a good idea.

Instead, we can just look at connhost[].host directly.  This does what
we want in v10 and up; in particular, if neither host nor hostaddr
were given, the host field will be replaced with the default host name.
That seems useful, and it's likely the reason that these places were
coded to call PQhost() originally (since pre-v10, the stored field was
not replaced with the default).

Back-patch to v10, as 1944cdc98 (just) was.

Discussion: https://postgr.es/m/23287.1533227021@sss.pgh.pa.us
2018-08-03 12:12:10 -04:00
..
po Translation updates 2018-05-07 11:59:42 -04:00
test Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-07-09 17:23:31 -04:00
.gitignore Add missing erand48.c to libpq/.gitignore. 2017-04-20 16:31:28 -04:00
exports.txt Add PQencryptPasswordConn function to libpq, use it in psql and createuser. 2017-05-03 11:19:07 +03:00
fe-auth-scram.c Tweak some SCRAM error messages and code comments 2017-08-23 12:29:47 -04:00
fe-auth.c Change libpq's internal uses of PQhost() to inspect host field directly. 2018-08-03 12:12:10 -04:00
fe-auth.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
fe-connect.c libpq: PQhost to return active connected host or hostaddr 2018-08-03 11:30:34 -04:00
fe-exec.c Teach libpq to detect integer overflow in the row count of a PGresult. 2017-08-29 15:18:01 -04:00
fe-lobj.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
fe-misc.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
fe-print.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
fe-protocol2.c In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:45 -04:00
fe-protocol3.c In libpq, free any partial query result before collecting a server error. 2018-04-13 12:53:45 -04:00
fe-secure-openssl.c Change libpq's internal uses of PQhost() to inspect host field directly. 2018-08-03 12:12:10 -04:00
fe-secure.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
libpq-events.c Update copyright via script for 2017 2017-01-03 13:48:53 -05:00
libpq-events.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
libpq-fe.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
libpq-int.h Allow multiple hostaddrs to go with multiple hostnames. 2017-07-10 12:28:57 +03:00
libpq.rc.in Stamp 10.4. 2018-05-07 16:51:40 -04:00
Makefile Add newly-symlinked files to "make clean" target. 2017-04-08 14:25:45 -04:00
nls.mk Translation updates 2018-02-05 12:27:10 -05:00
pg_service.conf.sample Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
pqexpbuffer.c Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pqexpbuffer.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
pthread-win32.c Remove useless duplicate inclusions of system header files. 2017-02-25 16:12:55 -05:00
README Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
win32.c Phase 3 of pgindent updates. 2017-06-21 15:35:54 -04:00
win32.h Remove support for bcc and msvc standalone libpq builds 2017-04-11 15:22:21 +02:00

src/interfaces/libpq/README

This directory contains the C version of Libpq, the POSTGRES frontend library.