pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: dblink: Avoid locking relation before privilege check.
Date: Tue, 14 Oct 2025 17:21:33 +0000
Message-ID: <E1v8iiL-001gui-0W@gemulon.postgresql.org> (raw)

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@j-davis.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(-)



Message-ID: <E1v8iiL-001gui-0W@gemulon.postgresql.org>
Permalink:  ../E1v8iiL-001gui-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v8iiL-001gui-0W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: dblink: Avoid locking relation before privilege check.
  In-Reply-To: <E1v8iiL-001gui-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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