pgsql: GetUserId() changes to has_privs_of_role()

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: GetUserId() changes to has_privs_of_role()
Date: 2015-03-19 19:02:47
Message-ID: E1YYfiR-0002vh-Nd@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2015-03-20 01:17:20 pgsql: psql: allow DROP INDEX CONCURRENTLY in AUTOCOMMIT off mode
Previous Message Robert Haas 2015-03-19 17:08:19 pgsql: Add flags argument to dsm_create.