From: Daniel Gustafsson Date: Tue, 7 Jul 2026 15:34:58 +0000 (+0200) Subject: Replace hardcoded mentions of pg_hosts.conf with GUC X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9df8d5b8e4f58ef81e6b592278207889863c367;p=thirdparty%2Fpostgresql.git Replace hardcoded mentions of pg_hosts.conf with GUC Three error messages were using the default file name pg_hosts.conf and not the variable backing the GUC, which would make logging be confusing for users who have renamed the file using the GUC. Fix by consistently using the HostsFileName variable. Backpatch down to v19 where serverside SNI was introduced. Author: Zsolt Parragi Reviewed-by: Surya Poondla Reviewed-by: Michael Paquier Discussion: https://postgr.es/m/CAN4CZFMARYjQfgyRaCKOXDO=Q91kuKn=pSC02DAOOr23ojhEGQ@mail.gmail.com Backpatch-through: 19 --- diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c index 7890e6c2de2..4ce2a92b964 100644 --- a/src/backend/libpq/be-secure-openssl.c +++ b/src/backend/libpq/be-secure-openssl.c @@ -228,7 +228,7 @@ be_tls_init(bool isServerStart) { ereport(isServerStart ? FATAL : LOG, errcode(ERRCODE_CONFIG_FILE_ERROR), - errmsg("could not load \"%s\": %s", "pg_hosts.conf", + errmsg("could not load \"%s\": %s", HostsFileName, err_msg ? err_msg : "unknown error")); goto error; } @@ -365,7 +365,7 @@ be_tls_init(bool isServerStart) errmsg("no SSL configurations loaded"), /*- translator: The two %s contain filenames */ errhint("If ssl_sni is enabled then add configuration to \"%s\", else \"%s\"", - "pg_hosts.conf", "postgresql.conf")); + HostsFileName, "postgresql.conf")); goto error; } @@ -644,7 +644,7 @@ init_host_context(HostsLine *host, bool isServerStart) "Set \"%s\" to \"off\" to make use of the hook " "that is currently installed, or remove the hook " "and use per-host passphrase commands in \"%s\".", - "ssl_sni", "pg_hosts.conf")); + "ssl_sni", HostsFileName)); init_warned = true; }