Re: Allow non-superuser to cancel superuser tasks.
Leung, Anthony <antholeu@amazon.com>
From: "Leung, Anthony" <antholeu@amazon.com>
To: "Andrey M. Borodin" <x4mmm@yandex-team.ru>, Nathan Bossart <nathandbossart@gmail.com>
Cc: Kirill Reshke <reshkekirill@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2024-04-04T00:36:45Z
Lists: pgsql-hackers
Update - the condition should be &&
if (pgstat_get_backend_type(proc->backendId) == B_AUTOVAC_WORKER)
{
if (!has_privs_of_role(GetUserId(), ROLE_PG_SIGNAL_AUTOVACUUM) && !superuser())
return SIGNAL_BACKEND_NOAUTOVACUUM;
}
Thanks
--
Anthony Leung
Amazon Web Services: https://aws.amazon.com
Commits
-
Look up backend type in pg_signal_backend() more cheaply.
- 61171a632d10 18.0 landed
-
Add tap test for pg_signal_autovacuum role
- d2b74882cab8 18.0 landed
-
Introduce pg_signal_autovacuum_worker.
- ccd38024bc3c 18.0 landed
-
Add a slot synchronization function.
- ddd5f4f54a02 17.0 cited
-
Ban role pg_signal_backend from more superuser backend types.
- 3a9b18b30953 17.0 cited