Fix a bug in roles_is_member_of.
Robert Haas <rhaas@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/acl.c | modified | +4 −4 |
| src/test/regress/expected/privileges.out | modified | +32 −0 |
| src/test/regress/sql/privileges.sql | modified | +25 −0 |
Discussion
- [PATCH v2] use has_privs_for_role for predefined roles 109 messages · 2021-10-27 → 2023-04-30