Commit 52ac42e
authored
fix: prevent non-superuser roles from dropping supabase_privileged_role (#2150)
Add supabase_privileged_role to supautils.reserved_roles so non-superusers
with CREATEROLE cannot drop it on PG 15, where PG's native ADMIN OPTION
check (introduced in PG 16) does not apply.
PG 16+ requires ADMIN OPTION to drop a non-superuser role:
https://github.com/postgres/postgres/blame/REL_16_STABLE/src/backend/commands/user.c#L1175
This check is absent in PG 15:
https://github.com/postgres/postgres/blob/REL_15_STABLE/src/backend/commands/user.c#L986
Fixes: https://linear.app/supabase/issue/PSQL-12051 parent 60c9ee9 commit 52ac42e
3 files changed
Lines changed: 34 additions & 1 deletion
File tree
- ansible/files/postgresql_config
- nix/tests
- expected
- sql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments