Re: role self-revocation
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>,
Peter Eisentraut <peter.eisentraut@enterprisedb.com>,
"David G. Johnston" <david.g.johnston@gmail.com>,
Joshua Brindle <joshua.brindle@crunchydata.com>,
Mark Dilger <mark.dilger@enterprisedb.com>,
Andrew Dunstan <andrew@dunslane.net>,
PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2022-03-24T17:10:26Z
Lists: pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes: > Notwithstanding the lack of agreement on that point, I believe that > what we should do for v15 is remove the session user > self-administration exception. We have pretty much established that it > was originally introduced in error. Agreed. > However, it might. And if it does, I think it would be best if > removing that exception were the *only* change in this area made by > that release. Good idea, especially since it's getting to be too late to consider anything more invasive anyway. > So I propose to commit something like what I posted here: > http://postgr.es/m/CA+TgmobgeK0JraOwQVPqhSXcfBdFitXSomoebHMMMhmJ4gLonw@mail.gmail.com +1, although the comments might need some more work. In particular, I'm not sure that this bit is well stated: + * A role cannot have WITH ADMIN OPTION on itself, because that would + * imply a membership loop. We already do consider a role to be a member of itself: regression=# create role r; CREATE ROLE regression=# grant r to r; ERROR: role "r" is a member of role "r" regression=# grant r to r with admin option; ERROR: role "r" is a member of role "r" It might be better to just say "By policy, a role cannot have WITH ADMIN OPTION on itself". But if you want to write a defense of that policy, this isn't a very good one. regards, tom lane
Commits
-
Make role grant system more consistent with other privileges.
- ce6b672e4455 16.0 landed
-
Ensure that pg_auth_members.grantor is always valid.
- 6566133c5f52 16.0 landed
-
Remove the ability of a role to administer itself.
- 79de9842ab03 15.0 landed
-
Add tests of the CREATEROLE attribute
- e9d4001ec592 15.0 landed
-
Replace explicit PIN entries in pg_depend with an OID range test.
- a49d08123599 15.0 cited
-
Shore up ADMIN OPTION restrictions.
- fea164a72a7b 9.4.0 cited
-
Add pg_has_role() family of privilege inquiry functions modeled after the
- f9fd1764615e 8.1.0 cited
-
Align GRANT/REVOKE behavior more closely with the SQL spec, per discussion
- 4b2dafcc0b1a 8.0.0 cited