pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: GetUserId() changes to has_privs_of_role()
Date: Thu, 19 Mar 2015 19:02:47 +0000
Message-ID: <E1YYfiR-0002vh-Nd@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

GetUserId() changes to has_privs_of_role()

The pg_stat and pg_signal-related functions have been using GetUserId()
instead of has_privs_of_role() for checking if the current user should
be able to see details in pg_stat_activity or signal other processes,
requiring a user to do 'SET ROLE' for inheirited roles for a permissions
check, unlike other permissions checks.

This patch changes that behavior to, instead, act like most other
permission checks and use has_privs_of_role(), removing the 'SET ROLE'
need.  Documentation and error messages updated accordingly.

Per discussion with Alvaro, Peter, Adam (though not using Adam's patch),
and Robert.

Reviewed by Jeevan Chalke.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bf038899965263dbc4aef2b43c8fdfe6f49b788f

Modified Files
--------------
doc/src/sgml/func.sgml              |   13 ++++++------
src/backend/utils/adt/misc.c        |   39 ++++++++++++++++++++++++++++-------
src/backend/utils/adt/pgstatfuncs.c |   19 +++++++++--------
3 files changed, 47 insertions(+), 24 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1YYfiR-0002vh-Nd@gemulon.postgresql.org>
Permalink:  ../E1YYfiR-0002vh-Nd@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YYfiR-0002vh-Nd@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: sfrost@snowman.net
  Subject: Re: pgsql: GetUserId() changes to has_privs_of_role()
  In-Reply-To: <E1YYfiR-0002vh-Nd@gemulon.postgresql.org>
  References: <E1YYfiR-0002vh-Nd@gemulon.postgresql.org>

* 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