pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Include policies based on ACLs needed
2+ messages / 1 participants
[nested] [flat]

* pgsql: Include policies based on ACLs needed
@ 2015-09-30 11:39  Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Stephen Frost @ 2015-09-30 11:39 UTC (permalink / raw)
  To: pgsql-committers

Include policies based on ACLs needed

When considering which policies should be included, rather than look at
individual bits of the query (eg: if a RETURNING clause exists, or if a
WHERE clause exists which is referencing the table, or if it's a
FOR SHARE/UPDATE query), consider any case where we've determined
the user needs SELECT rights on the relation while doing an UPDATE or
DELETE to be a case where we apply SELECT policies, and any case where
we've deteremind that the user needs UPDATE rights on the relation while
doing a SELECT to be a case where we apply UPDATE policies.

This simplifies the logic and addresses concerns that a user could use
UPDATE or DELETE with a WHERE clauses to determine if rows exist, or
they could use SELECT .. FOR UPDATE to lock rows which they are not
actually allowed to modify through UPDATE policies.

Use list_append_unique() to avoid adding the same quals multiple times,
as, on balance, the cost of checking when adding the quals will almost
always be cheaper than keeping them and doing busywork for each tuple
during execution.

Back-patch to 9.5 where RLS was added.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7d8db3e8f37aec9d252353904e77381a18a2fa9f

Modified Files
--------------
src/backend/rewrite/rowsecurity.c         |  108 ++++++++++++++++++++---------
src/test/regress/expected/rowsecurity.out |   60 ++++++++--------
2 files changed, 101 insertions(+), 67 deletions(-)


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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Include policies based on ACLs needed
@ 2015-09-30 11:39  Stephen Frost <sfrost@snowman.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Stephen Frost @ 2015-09-30 11:39 UTC (permalink / raw)
  To: pgsql-committers

Include policies based on ACLs needed

When considering which policies should be included, rather than look at
individual bits of the query (eg: if a RETURNING clause exists, or if a
WHERE clause exists which is referencing the table, or if it's a
FOR SHARE/UPDATE query), consider any case where we've determined
the user needs SELECT rights on the relation while doing an UPDATE or
DELETE to be a case where we apply SELECT policies, and any case where
we've deteremind that the user needs UPDATE rights on the relation while
doing a SELECT to be a case where we apply UPDATE policies.

This simplifies the logic and addresses concerns that a user could use
UPDATE or DELETE with a WHERE clauses to determine if rows exist, or
they could use SELECT .. FOR UPDATE to lock rows which they are not
actually allowed to modify through UPDATE policies.

Use list_append_unique() to avoid adding the same quals multiple times,
as, on balance, the cost of checking when adding the quals will almost
always be cheaper than keeping them and doing busywork for each tuple
during execution.

Back-patch to 9.5 where RLS was added.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/75096c458aa8e27160112cc20a18fec3a111e4b0

Modified Files
--------------
src/backend/rewrite/rowsecurity.c         |  108 ++++++++++++++++++++---------
src/test/regress/expected/rowsecurity.out |   60 ++++++++--------
2 files changed, 101 insertions(+), 67 deletions(-)


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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-09-30 11:39 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-30 11:39 pgsql: Include policies based on ACLs needed Stephen Frost <sfrost@snowman.net>
2015-09-30 11:39 pgsql: Include policies based on ACLs needed Stephen Frost <sfrost@snowman.net>

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