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: Enforce ALL/SELECT policies in RETURNING for RLS
Date: Tue, 15 Sep 2015 19:49:50 +0000
Message-ID: <E1ZbwEg-0004Cz-Qv@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Enforce ALL/SELECT policies in RETURNING for RLS

For the UPDATE/DELETE RETURNING case, filter the records which are not
visible to the user through ALL or SELECT policies from those considered
for the UPDATE or DELETE.  This is similar to how the GRANT system
works, which prevents RETURNING unless the caller has SELECT rights on
the relation.

Per discussion with Robert, Dean, Tom, and Kevin.

Back-patch to 9.5 where RLS was introduced.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/68b5201128c2d0c8a3a0051ff7c2534b037e1eab

Modified Files
--------------
src/backend/rewrite/rowsecurity.c         |   47 +++++++++++++++++++++++++++
src/test/regress/expected/rowsecurity.out |   50 ++++++++++++++++-------------
2 files changed, 74 insertions(+), 23 deletions(-)


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


view thread (2+ messages)

Message-ID: <E1ZbwEg-0004Cz-Qv@gemulon.postgresql.org>
Permalink:  ../E1ZbwEg-0004Cz-Qv@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ZbwEg-0004Cz-Qv@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: Enforce ALL/SELECT policies in RETURNING for RLS
  In-Reply-To: <E1ZbwEg-0004Cz-Qv@gemulon.postgresql.org>
  References: <E1ZbwEg-0004Cz-Qv@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