pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix ExecCheckPermissions call in RI_Initial_Check
Date: Thu, 04 May 2023 17:58:26 +0000
Message-ID: <E1pudDm-000Tck-BV@gemulon.postgresql.org> (raw)

Fix ExecCheckPermissions call in RI_Initial_Check

RI_Initial_Check was setting up a list of RTEPermissionInfo for
ExecCheckPermissions() wrong, and the problem is subtle enough that it
doesn't have any immediate effect in core code.  However, if an
extension is using the ExecutorCheckPerms_hook, then it would get the
wrong parameters and perhaps arrive at a wrong conclusion, or outright
malfunction.  Fix by constructing that list and the RTE list more
honestly.

We also add an assertion check to verify that these lists match.  This
new assertion would have caught this bug.

Co-authored-by: Олег Целебровский (Oleg Tselebrovskii) <o.tselebrovskiy@postgrespro.ru>
Co-authored-by: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Amit Langote <amitlangote09@gmail.com>
Discussion: https://postgr.es/m/3722b7a2cbe27a1796ee40824bd86dd1@postgrespro.ru

Branch
------
master

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

Modified Files
--------------
src/backend/executor/execMain.c     | 22 +++++++++++++++++++
src/backend/utils/adt/ri_triggers.c | 42 +++++++++++++++++++++----------------
2 files changed, 46 insertions(+), 18 deletions(-)



Message-ID: <E1pudDm-000Tck-BV@gemulon.postgresql.org>
Permalink:  ../E1pudDm-000Tck-BV@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pudDm-000Tck-BV@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: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix ExecCheckPermissions call in RI_Initial_Check
  In-Reply-To: <E1pudDm-000Tck-BV@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