postgresql/src/backend/rewrite
Dean Rasheed 157dcf534f Perform RLS subquery checks as the right user when going via a view.
When accessing a table with RLS via a view, the RLS checks are
performed as the view owner. However, the code neglected to propagate
that to any subqueries in the RLS checks. Fix that by calling
setRuleCheckAsUser() for all RLS policy quals and withCheckOption
checks for RTEs with RLS.

Back-patch to 9.5 where RLS was added.

Per bug #15708 from daurnimator.

Discussion: https://postgr.es/m/15708-d65cab2ce9b1717a@postgresql.org
2019-04-02 08:17:04 +01:00
..
Makefile Row-Level Security Policies (RLS) 2014-09-19 11:18:35 -04:00
rewriteDefine.c Combine options for RangeVarGetRelidExtended() into a flags argument. 2018-03-30 17:05:16 -07:00
rewriteHandler.c Further fixing for multi-row VALUES lists for updatable views. 2019-03-03 10:52:54 +00:00
rewriteManip.c Fix typo in comment. 2018-04-09 14:20:13 +03:00
rewriteRemove.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
rewriteSupport.c Update copyright for 2018 2018-01-02 23:30:12 -05:00
rowsecurity.c Perform RLS subquery checks as the right user when going via a view. 2019-04-02 08:17:04 +01:00