git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 6c6d6ba) | patch
Adjust interaction of CREATEROLE with role properties.
2023年1月24日 15:57:09 +0000 (10:57 -0500)
2023年1月24日 15:57:09 +0000 (10:57 -0500)
commit f1358ca52dd7b8cedd29c6f2f8c163914f03ea2e
Adjust interaction of CREATEROLE with role properties.

Previously, a CREATEROLE user without SUPERUSER could not alter
REPLICATION users in any way, and could not set the BYPASSRLS
attribute. However, they could manipulate the CREATEDB property
even if they themselves did not possess it.

With this change, a CREATEROLE user without SUPERUSER can set or
clear the REPLICATION, BYPASSRLS, or CREATEDB property on a new
role or a role that they have rights to manage if and only if
that property is set for their own role.

This implements the standard idea that you can't give permissions
you don't have (but you can give the ones you do have). We might
in the future want to provide more powerful ways to constrain
what a CREATEROLE user can do - for example, to limit whether
CONNECTION LIMIT can be set or the values to which it can be set -
but that is left as future work.

Patch by me, reviewed by Nathan Bossart, Tushar Ahuja, and Neha
Sharma.

Discussion: http://postgr.es/m/CA+TgmobX=LHg_J5aT=0pi9gJy=JdtrUVGAu0zhr-i5v5nNbJDg@mail.gmail.com
doc/src/sgml/ref/alter_role.sgml diff | blob | blame | history
doc/src/sgml/ref/create_role.sgml diff | blob | blame | history
src/backend/commands/dbcommands.c diff | blob | blame | history
src/backend/commands/user.c diff | blob | blame | history
src/include/commands/dbcommands.h diff | blob | blame | history
src/test/regress/expected/create_role.out diff | blob | blame | history
src/test/regress/sql/create_role.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /