pgsql: dblink: Avoid locking relation before privilege check.

From: Nathan Bossart <nathan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: dblink: Avoid locking relation before privilege check.
Date: 2025-10-14 17:21:33
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

dblink: Avoid locking relation before privilege check.

The present coding of dblink's get_rel_from_relname() predates the
introduction of RangeVarGetRelidExtended(), which provides a way to
check permissions before locking the relation. This commit adjusts
get_rel_from_relname() to use that function.

Reviewed-by: Jeff Davis <pgsql(at)j-davis(dot)com>
Discussion: https://postgr.es/m/aOgmi6avE6qMw_6t%40nathan

Branch
------
master

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

Modified Files
--------------
contrib/dblink/dblink.c | 29 +++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2025-10-14 18:07:17 pgsql: pg_regc_locale.c: rename some static functions.
Previous Message Melanie Plageman 2025-10-14 14:15:07 pgsql: Bump XLOG_PAGE_MAGIC after xl_heap_prune change