pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix handling of escape sequences in postgres_fdw.application_nam 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix handling of escape sequences in postgres_fdw.application_nam @ 2023-02-21 11:02 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2023-02-21 11:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of escape sequences in postgres_fdw.application_name postgres_fdw.application_name relies on MyProcPort to define the data that should be added to escape sequences %u (user name) or %d (database name). However this code could be run in processes that lack a MyProcPort, like an autovacuum process, causing crashes. The code generating the application name is made more flexible with this commit, so as it now generates no data for %u and %d if MyProcPort is missing, and a simple "unknown" if MyProcPort exists, but the expected fields are not set. Reported-by: Alexander Lakhin Author: Kyotaro Horiguchi, Michael Paquier Reviewed-by: Hayato Kuroda, Masahiko Sawada Discussion: https://postgr.es/m/17789-8b31c5a4672b74d9@postgresql.org Backpatch-through: 15 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/8427ce4c379ee3774b8a9aca13ca7f4bfb76ba85 Modified Files -------------- contrib/postgres_fdw/option.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix handling of escape sequences in postgres_fdw.application_nam @ 2023-02-21 11:02 Michael Paquier <michael@paquier.xyz> 0 siblings, 0 replies; 2+ messages in thread From: Michael Paquier @ 2023-02-21 11:02 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix handling of escape sequences in postgres_fdw.application_name postgres_fdw.application_name relies on MyProcPort to define the data that should be added to escape sequences %u (user name) or %d (database name). However this code could be run in processes that lack a MyProcPort, like an autovacuum process, causing crashes. The code generating the application name is made more flexible with this commit, so as it now generates no data for %u and %d if MyProcPort is missing, and a simple "unknown" if MyProcPort exists, but the expected fields are not set. Reported-by: Alexander Lakhin Author: Kyotaro Horiguchi, Michael Paquier Reviewed-by: Hayato Kuroda, Masahiko Sawada Discussion: https://postgr.es/m/17789-8b31c5a4672b74d9@postgresql.org Backpatch-through: 15 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/5bace41abc317ae8ecf3397e9e92f3b0e5444c69 Modified Files -------------- contrib/postgres_fdw/option.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-02-21 11:02 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-02-21 11:02 pgsql: Fix handling of escape sequences in postgres_fdw.application_nam Michael Paquier <michael@paquier.xyz> 2023-02-21 11:02 pgsql: Fix handling of escape sequences in postgres_fdw.application_nam Michael Paquier <michael@paquier.xyz>
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