pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Laurenz Albe <laurenz.albe@cybertec.at>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18387: Erroneous permission checks and/or misleading error messages with refresh materialized view
Date: Thu, 14 Mar 2024 22:36:10 -0400
Message-ID: <ZfO0GvqLn7Xb7sgq@momjian.us> (raw)
In-Reply-To: <2076079.1710354775@sss.pgh.pa.us>
References: <18387-12041858d9efb6f6@postgresql.org>
	<36bb333d-13ec-4f8e-af33-48249ca2fe69@iki.fi>
	<CAK-MWwQBrjfAPu=nfWS9B_Y5QK147xU2Y-EpDYAvsrdni97HCw@mail.gmail.com>
	<09970dbb6f95a34d9427c32b09517ea709c77d02.camel@cybertec.at>
	<ZfHdeer_0QxksV5p@momjian.us>
	<2076079.1710354775@sss.pgh.pa.us>

On Wed, Mar 13, 2024 at 02:32:55PM -0400, Tom Lane wrote:
> I think there's been a policy of being minimalistic on
> permission-denied errors to avoid giving away security information,
> but I'm not sure how much sense that really makes.  We already show
> the specific object that didn't have permissions.  I think it would
> be good for these errors to also mention the specific role whose
> permissions were checked.  Perhaps also show the specific privileges
> that were missing --- although it might be hard to do that in a
> non-confusing way for complicated cases, such as queries that are
> valid if you have either table- or column-level permissions.
> 
> If we just add the role I'd envision
> 
> ERROR:  permission denied to role "foo" for [object]
> 
> although with any more detail that would get too long.
> Another way could be
> 
> ERROR:  permission denied for [object]
> DETAIL:  Role "foo" lacks permission [permission].
> 
> Mentioning the role that was checked should address the concern
> of "I'm a superuser, why did I get this error?".  However,
> fixing it requires knowing which privilege to grant.  I'm not
> sure if that's always obvious.

If we don't want to expand the error, and I can see why we might not
want to, giving the detailed error only for the superuser would be safe,
I think, since they are already the superuser.

Personal note:  my son Matthew got this error when using photoview
software, and I was confused why the superuser was getting a permission
error.

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EDB                                      https://enterprisedb.com

  Only you can decide what is important to you.





view thread (11+ messages)

Message-ID: <ZfO0GvqLn7Xb7sgq@momjian.us>
Permalink:  ../ZfO0GvqLn7Xb7sgq@momjian.us/
Also on:    postgresql.org/message-id/ZfO0GvqLn7Xb7sgq@momjian.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-bugs@postgresql.org
  Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, laurenz.albe@cybertec.at, maxim.boguk@gmail.com, hlinnaka@iki.fi
  Subject: Re: BUG #18387: Erroneous permission checks and/or misleading error messages with refresh materialized view
  In-Reply-To: <ZfO0GvqLn7Xb7sgq@momjian.us>
  References: <18387-12041858d9efb6f6@postgresql.org> <36bb333d-13ec-4f8e-af33-48249ca2fe69@iki.fi> <CAK-MWwQBrjfAPu=nfWS9B_Y5QK147xU2Y-EpDYAvsrdni97HCw@mail.gmail.com> <09970dbb6f95a34d9427c32b09517ea709c77d02.camel@cybertec.at> <ZfHdeer_0QxksV5p@momjian.us> <2076079.1710354775@sss.pgh.pa.us> <ZfO0GvqLn7Xb7sgq@momjian.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