Обсуждение: pgsql: Fix a bug in roles_is_member_of.

Поиск
Список
Период
Сортировка

pgsql: Fix a bug in roles_is_member_of.

От
Robert Haas
Дата:
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(-)