From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?
Date: Tue, 13 Sep 2022 00:49:02 -0400
Message-ID: <1883844.1663044542@sss.pgh.pa.us> (raw)
In-Reply-To: <E34C9A5F-832D-444C-8798-89BA8F5B386C@yugabyte.com>
References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com>
<CAKFQuwYr78FAFX4dFL3Mp4qiBZHzQtChTmO91d9FvYn09GzCfw@mail.gmail.com>
<2F078227-5EEF-4553-89FF-046A6AF12F25@yugabyte.com>
<CAKFQuwZVq-LerGMTN0E3_7MqhJwtuJuzf0GSnKG32mH_Qf24Zw@mail.gmail.com>
<E34C9A5F-832D-444C-8798-89BA8F5B386C@yugabyte.com>
Bryn Llewellyn <bryn@yugabyte.com> writes:
> My non-superuser normalrole with direct login, "u1", is *still* able to invoke pg_terminate_backend() and kill other "u1" sessions—even after this (as a super-user):
Really?
I did this in 14.5:
regression=# revoke execute on function pg_terminate_backend from public;
REVOKE
regression=# select proacl from pg_proc where proname = 'pg_terminate_backend';
proacl
-----------------------
{postgres=X/postgres}
(1 row)
(as expected, the superuser's own execute permission is all that remains)
regression=# create user joe;
CREATE ROLE
regression=# \c - joe
You are now connected to database "regression" as user "joe".
regression=> select pg_terminate_backend(42);
ERROR: permission denied for function pg_terminate_backend
> It very much looks as if what I have describe was deemed to be a bug (after that behavior had survived from at least version 11) and that it's now been fixed!
No, it very much looks like pilot error. But you've not shown
us exactly what your test consisted of, so it's hard to say just
where it went off the rails.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, bryn@yugabyte.com, david.g.johnston@gmail.com
Subject: Re: Is it possible to stop sessions killing eachother when they all authorize as the same role?
In-Reply-To: <1883844.1663044542@sss.pgh.pa.us>
References: <10F360BB-3149-45E6-BFFE-10B9AE31F1A6@yugabyte.com> <CAKFQuwYr78FAFX4dFL3Mp4qiBZHzQtChTmO91d9FvYn09GzCfw@mail.gmail.com> <2F078227-5EEF-4553-89FF-046A6AF12F25@yugabyte.com> <CAKFQuwZVq-LerGMTN0E3_7MqhJwtuJuzf0GSnKG32mH_Qf24Zw@mail.gmail.com> <E34C9A5F-832D-444C-8798-89BA8F5B386C@yugabyte.com> <1883844.1663044542@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox