postgresql/src/backend/catalog
Robert Haas 48a257d444 Make ALTER DEFAULT PRIVILEGES require privileges, not membership.
If role A is a direct or indirect member of role B but does not inherit
B's privileges (because at least one relevant grant was created WITH
INHERIT FALSE) then A should not be permitted to bypass privilege
checks that require the privileges of B. For example, A can't change
the privileges of objects owned by B, nor can A drop those objects.

However, up until now, it's been possible for A to change default
privileges for role B. That doesn't seem to be correct, because a
non-inherited role grant is only supposed to permit you to assume
the identity of the granted role via SET ROLE, and should not
otherwise permit you to exercise the privileges of that role. Most
places followed that rule, but this case was an exception.

This could be construed as a security vulnerability, but it does not
seem entirely clear cut, since older branches were fuzzy about the
distinction between is_member_of_role() and has_privs_of_role() in
a number of other ways as well. Because of this, and because
user-visible behavior changes in minor releases are to be avoided
whenever possible, no back-patch.

Discussion: http://postgr.es/m/CA+TgmobG_YUP06R_PM_2Z7wR0qv_52gQPHD8CYXbJva0cf0E+A@mail.gmail.com
2022-09-19 14:21:59 -04:00
..
.gitignore Build in some knowledge about foreign-key relationships in the catalogs. 2021-02-02 17:11:55 -05:00
Catalog.pm Make eval statement naturally proof against perltidy 2022-09-12 11:59:43 +07:00
Makefile Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
aclchk.c Make ALTER DEFAULT PRIVILEGES require privileges, not membership. 2022-09-19 14:21:59 -04:00
catalog.c Ensure that pg_auth_members.grantor is always valid. 2022-08-18 13:13:02 -04:00
dependency.c Ensure that pg_auth_members.grantor is always valid. 2022-08-18 13:13:02 -04:00
genbki.pl Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
heap.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
index.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
indexing.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
information_schema.sql Fix bogus dependency handling for GENERATED expressions. 2022-03-21 14:58:49 -04:00
namespace.c Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
objectaccess.c Pre-beta mechanical code beautification. 2022-05-12 15:17:30 -04:00
objectaddress.c Ensure that pg_auth_members.grantor is always valid. 2022-08-18 13:13:02 -04:00
partition.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_aggregate.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_attrdef.c Fix typos. 2022-09-19 14:21:39 +05:30
pg_cast.c Replace many MemSet calls with struct initialization 2022-07-16 08:50:49 +02:00
pg_class.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_collation.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
pg_constraint.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
pg_conversion.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_db_role_setting.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_depend.c Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
pg_enum.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_inherits.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_largeobject.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_namespace.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_operator.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
pg_parameter_acl.c Split up guc.c for better build speed and ease of maintenance. 2022-09-13 11:11:45 -04:00
pg_proc.c Add construct_array_builtin, deconstruct_array_builtin 2022-07-01 11:23:15 +02:00
pg_publication.c Move common catalog cache access routines to lsyscache.c 2022-08-02 10:47:22 +05:30
pg_range.c Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_shdepend.c Ensure that pg_auth_members.grantor is always valid. 2022-08-18 13:13:02 -04:00
pg_subscription.c Move common catalog cache access routines to lsyscache.c 2022-08-02 10:47:22 +05:30
pg_type.c In extensions, don't replace objects not belonging to the extension. 2022-08-08 11:12:31 -04:00
sql_feature_packages.txt Cleanup in SQL features files 2020-03-28 08:46:18 +01:00
sql_features.txt Revert SQL/JSON features 2022-09-01 17:07:14 -04:00
storage.c Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
system_functions.sql Support pg_read_[binary_]file (filename, missing_ok). 2022-07-29 15:38:49 -04:00
system_views.sql Fix new pg_publication_tables query. 2022-09-06 18:00:32 -04:00
toasting.c Add UNIQUE null treatment option 2022-02-03 11:48:21 +01:00