pgsql: Fix a bug in roles_is_member_of.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix a bug in roles_is_member_of.
Date: 2022-08-31 12:29:00
Message-ID: E1oTMq3-000koa-Pk@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix a bug in roles_is_member_of.

Commit e3ce2de09d814f8770b2e3b3c152b7671bcdb83f rearranged this
function to be able to identify which inherited role had admin option
on the target role, but it got the order of operations wrong, causing
the function to return wrong answers in the presence of non-inherited
grants.

Fix that, and add a test case that verifies the correct behavior.

Patch by me, reviewed by Nathan Bossart

Discussion: http://postgr.es/m/CA+TgmoYamnu-xt-u7CqjYWnRiJ6BQaSpYOHXP=r4QGTfd1N_EA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0101f770a05b07dd7a8e05b6f8f95d4e22f4e846

Modified Files
--------------
src/backend/utils/adt/acl.c | 8 ++++----
src/test/regress/expected/privileges.out | 32 ++++++++++++++++++++++++++++++++
src/test/regress/sql/privileges.sql | 25 +++++++++++++++++++++++++
3 files changed, 61 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2022-08-31 14:42:21 pgsql: In the Snowball dictionary, don't try to stem excessively-long w
Previous Message Daniel Gustafsson 2022-08-31 11:36:55 pgsql: doc: Fix typo in user inheritance documentation