pgsql: Fix GRANTED BY support in REVOKE ROLE statements - Mailing list pgsql-committers

From Daniel Gustafsson
Subject pgsql: Fix GRANTED BY support in REVOKE ROLE statements
Date
Msg-id E1mqb4v-00066U-2z@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(+)


pgsql-committers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: pgsql: Fix GRANTED BY support in REVOKE ROLE statements
Next
From: Robert Haas
Date:
Subject: Re: pgsql: xlog.c: Remove global variables ReadRecPtr and EndRecPtr.