pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Change libpq's internal uses of PQhost() to inspect host field d 3+ messages / 1 participants [nested] [flat]
* pgsql: Change libpq's internal uses of PQhost() to inspect host field d @ 2018-08-03 16:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2018-08-03 16:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/24986c95520e0761dbb3551196fda2305228557c Modified Files -------------- src/interfaces/libpq/fe-auth.c | 4 ++-- src/interfaces/libpq/fe-secure-common.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Change libpq's internal uses of PQhost() to inspect host field d @ 2018-08-03 16:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2018-08-03 16:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/6efc30167188f2adea8741dc1b69f6536b2c9b44 Modified Files -------------- src/interfaces/libpq/fe-auth.c | 4 ++-- src/interfaces/libpq/fe-secure-common.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Change libpq's internal uses of PQhost() to inspect host field d @ 2018-08-03 16:21 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2018-08-03 16:21 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/8d00858bafb50a8fb06c7e9482af2bfef2eebc75 Modified Files -------------- src/interfaces/libpq/fe-auth.c | 4 ++-- src/interfaces/libpq/fe-secure-openssl.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-08-03 16:21 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-08-03 16:21 pgsql: Change libpq's internal uses of PQhost() to inspect host field d Tom Lane <tgl@sss.pgh.pa.us> 2018-08-03 16:21 pgsql: Change libpq's internal uses of PQhost() to inspect host field d Tom Lane <tgl@sss.pgh.pa.us> 2018-08-03 16:21 pgsql: Change libpq's internal uses of PQhost() to inspect host field d Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox