pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dominique Devienne <ddevienne@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Trouble DROP'ing a ROLE, despite REVOKE'ing its privileges
Date: Wed, 05 Jan 2022 14:04:26 -0500
Message-ID: <796772.1641409466@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFCRh-_djkeV9_VC+9XLM4MhbQKyLBYTVqte8S=guOmOMbtyew@mail.gmail.com>
References: <CAFCRh-9-VLhZFtocQaPOz5At3tAxUgivie8K5Dq8b=kNJ1EGXw@mail.gmail.com>
	<792111.1641407185@sss.pgh.pa.us>
	<CAFCRh-_djkeV9_VC+9XLM4MhbQKyLBYTVqte8S=guOmOMbtyew@mail.gmail.com>

[ please keep the list cc'd ]

Dominique Devienne <ddevienne@gmail.com> writes:
> On Wed, Jan 5, 2022 at 7:26 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> That will only revoke privileges that were granted by the role
>> doing the REVOKE, so I surmise that you did this as some other role.

> Hmmm, that's interesting... But it brings up something I didn't think of.
> The point of making a NOLOGIN ROLE for the owner of all DB objects,
> is to be able to GRANT that ROLE to several LOGIN USERs, which are
> all basicall Administrators of that system. So any one of them should be
> able to DROP the whole shebang, but what you are saying seems to be
> that only the admin that *originally* created the "shebang" can get rid of
> "owner" ROLE, or a SUPERUSER of course. Is that correct?

The admins would need to be careful to SET ROLE to the shared role
when manipulating privileges granted by that role --- either to
grant them, or to revoke them.

Alternatively, they could be careful to specify "GRANTED BY shared_role"
in all these commands.  But I think our coverage for that option isn't
complete, especially in older branches.

(IIRC there is some hack that causes superuser-issued revokes
to nuke privileges granted by the object's owner, even without an
explicit GRANTED BY.  But that doesn't apply to ordinary users.)

			regards, tom lane





view thread (4+ messages)

Message-ID: <796772.1641409466@sss.pgh.pa.us>
Permalink:  ../796772.1641409466@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/796772.1641409466@sss.pgh.pa.us

 · 

reply

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, ddevienne@gmail.com
  Subject: Re: Trouble DROP'ing a ROLE, despite REVOKE'ing its privileges
  In-Reply-To: <796772.1641409466@sss.pgh.pa.us>
  References: <CAFCRh-9-VLhZFtocQaPOz5At3tAxUgivie8K5Dq8b=kNJ1EGXw@mail.gmail.com> <792111.1641407185@sss.pgh.pa.us> <CAFCRh-_djkeV9_VC+9XLM4MhbQKyLBYTVqte8S=guOmOMbtyew@mail.gmail.com> <796772.1641409466@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