pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: o.tselebrovskiy@postgrespro.ru
Cc: pgsql-hackers@postgresql.org, s.shinderuk@postgrespro.ru, Amit Langote <amitlangote09@gmail.com>
Subject: Re: A bug with ExecCheckPermissions
Date: Wed, 8 Feb 2023 11:49:00 +0100
Message-ID: <20230208104900.fvpikobjumzwqkk3@alvherre.pgsql> (raw)
In-Reply-To: <3722b7a2cbe27a1796ee40824bd86dd1@postgrespro.ru>

On 2023-Feb-08, o.tselebrovskiy@postgrespro.ru wrote:

> But if you debug function ExecCheckPermissions and look into what is passed
> to function (contents of rangeTable and rteperminfos to be exact),
> you'll see some strange behaviour:

> Both of RangeTableEntries have a perminfoindex of 0 and simultaneously have
> a RTEPERMISSIONINFO entry for them!

Ouch.  Yeah, that's not great.  As you say, it doesn't really affect
anything, and we know full well that these RTEs are ad-hoc
manufactured.  But as we claim that we still pass the RTEs for the
benefit of hooks, then we should at least make them match.

I think we should also patch ExecCheckPermissions to use forboth(),
scanning the RTEs as it goes over the perminfos, and make sure that the
entries are consistent.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/





view thread (11+ messages)  latest in thread

Message-ID: <20230208104900.fvpikobjumzwqkk3@alvherre.pgsql>
Permalink:  ../20230208104900.fvpikobjumzwqkk3@alvherre.pgsql/
Also on:    postgresql.org/message-id/20230208104900.fvpikobjumzwqkk3@alvherre.pgsql

 · 

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-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, o.tselebrovskiy@postgrespro.ru, amitlangote09@gmail.com
  Subject: Re: A bug with ExecCheckPermissions
  In-Reply-To: <20230208104900.fvpikobjumzwqkk3@alvherre.pgsql>

* 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