Re: pg_auth_members.grantor is bunk

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Jacob Champion <jchampion(at)timescale(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_auth_members.grantor is bunk
Date: 2022-08-01 19:51:03
Message-ID: CA+TgmoZ5SYLe0HsZNZm1==XPT18exPWYY0Qkd9+_Uz2bKyqKEA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Aug 1, 2022 at 1:38 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I think the latter --- the cfbot thinks the July CF is no longer relevant,
> but Jacob hasn't yet moved your patches forward. You could wait for
> him to do that, or do it yourself.

Done. New patches attached.

Changes in v4, for 0001:

- Typo fix.
- Whitespace fixes.

Changes in v4, for 0002:

- Remove "XXX sketchy" comment because the thing in question turns out
not to be sketchy. It has to do with the behavior of ALTER GROUP ..
DROP USER and, having investigated the situation, I think the
messaging is clear enough.
- But just to be sure, add a note to the ALTER GROUP documentation to
try to make things more clear.
- Wording fixes to the "If <literal>GRANTED BY</literal> is
specified..." paragraph of the GRANT documentation. I reworded this a
bit more extensively than what Stephen proposed. Hopefully this is
clearer now, or at least no longer missing any words.
- Change message to "admin option cannot be granted back to your own
grantor". The choice of message is intended to be consistent with the
existing message "grant options cannot be granted back to your own
grantor," but while there's one grant option per privilege, there's
only one admin option. Stephen suggested adopting a message that I had
meant to take out of the version I posted, but which ended up
surviving in one place, "grants with admin options cannot be
circular". And we could still decide to do something like that, but my
enthusiasm for that direction was considerably reduced when I realized
that "circular" is not very clear at all, because there are multiple
kinds of circularities (role-member, member-grantor).
- Fix comment to say DROP_RESTRICT instead of DROP_RECURSE.
- Make the comment for check_role_grantor() longer so that it can
better explain itself.
- Rephrase part of the header comment for initialize_revoke_actions()
because Stephen found it awkward.
- Whitespace fixes.

--
Robert Haas
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v4-0002-Make-role-grant-system-more-consistent-with-other.patch application/octet-stream 57.2 KB
v4-0001-Ensure-that-pg_auth_members.grantor-is-always-val.patch application/octet-stream 32.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2022-08-01 19:51:33 Re: Making Vars outer-join aware
Previous Message Andrew Dunstan 2022-08-01 19:50:58 Re: [feature]COPY FROM enable FORCE_NULL/FORCE_NOT_NULL on all columns