pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix GRANTED BY support in REVOKE ROLE statements
Date: Fri, 26 Nov 2021 13:15:49 +0000
Message-ID: <E1mqb4v-00066U-2z@gemulon.postgresql.org> (raw)

Fix GRANTED BY support in REVOKE ROLE statements

Commit 6aaaa76bb added support for the GRANTED BY clause in GRANT and
REVOKE statements, but missed adding support for checking the role in
the REVOKE ROLE case. Fix by checking that the parsed role matches the
CURRENT_ROLE/CURRENT_USER requirement, and also add some tests for it.
Backpatch to v14 where GRANTED BY support was introduced.

Discussion: https://postgr.es/m/B7F6699A-A984-4943-B9BF-CEB84C003527@yesql.se
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/371087d006e04991080bf17cf2287db38d3ea92e

Modified Files
--------------
src/backend/commands/user.c              | 11 +++++++++++
src/backend/parser/gram.y                |  2 ++
src/test/regress/expected/privileges.out |  9 +++++++++
src/test/regress/sql/privileges.sql      |  8 ++++++++
4 files changed, 30 insertions(+)



view thread (2+ messages)

Message-ID: <E1mqb4v-00066U-2z@gemulon.postgresql.org>
Permalink:  ../E1mqb4v-00066U-2z@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mqb4v-00066U-2z@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org
  Subject: Re: pgsql: Fix GRANTED BY support in REVOKE ROLE statements
  In-Reply-To: <E1mqb4v-00066U-2z@gemulon.postgresql.org>
  References: <E1mqb4v-00066U-2z@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