pgsql: libpq-oauth: Never link against libpq's encoding functions

From: Jacob Champion <jchampion(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: libpq-oauth: Never link against libpq's encoding functions
Date: 2026-03-13 16:38:51
Message-ID: E1w15XH-003rMt-1b@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

libpq-oauth: Never link against libpq's encoding functions

Now that libpq-oauth doesn't have to match the major version of libpq,
some things in pg_wchar.h are technically unsafe for us to use. (See
b6c7cfac8 for a fuller discussion.) This is unlikely to be a problem --
we only care about UTF-8 in the context of OAuth right now -- but if
anyone did introduce a way to hit it, it'd be extremely difficult to
debug or reproduce, and it'd be a potential security vulnerability to
boot.

Define USE_PRIVATE_ENCODING_FUNCS so that anyone who tries to add a
dependency on the exported APIs will simply fail to link the shared
module.

Reviewed-by: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Reviewed-by: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
Discussion: https://postgr.es/m/CAOYmi%2BmrGg%2Bn_X2MOLgeWcj3v_M00gR8uz_D7mM8z%3DdX1JYVbg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dba35604485feff679893f22a79e8c0f3ee6fc0e

Modified Files
--------------
src/interfaces/libpq-oauth/Makefile | 11 +++++++++--
src/interfaces/libpq-oauth/meson.build | 10 +++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Nathan Bossart 2026-03-13 16:45:56 pgsql: Add commit b6eb8dde6b to .git-blame-ignore-revs.
Previous Message Nathan Bossart 2026-03-13 16:32:44 pgsql: Initialize variable to placate compiler.