pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Perform RLS subquery checks as the right user when going via a v 5+ messages / 1 participants [nested] [flat]
* pgsql: Perform RLS subquery checks as the right user when going via a v @ 2019-04-02 07:31 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 5+ messages in thread From: Dean Rasheed @ 2019-04-02 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/e2d28c0f404713f564dc2250646551c75172f17b Modified Files -------------- src/backend/rewrite/rowsecurity.c | 8 ++++++++ src/test/regress/expected/rowsecurity.out | 27 +++++++++++++++++++++++++++ src/test/regress/sql/rowsecurity.sql | 26 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Perform RLS subquery checks as the right user when going via a v @ 2019-04-02 07:31 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 5+ messages in thread From: Dean Rasheed @ 2019-04-02 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/157dcf534f8e12486d425d6c0d111c065fbbb841 Modified Files -------------- src/backend/rewrite/rowsecurity.c | 8 ++++++++ src/test/regress/expected/rowsecurity.out | 27 +++++++++++++++++++++++++++ src/test/regress/sql/rowsecurity.sql | 26 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Perform RLS subquery checks as the right user when going via a v @ 2019-04-02 07:31 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 5+ messages in thread From: Dean Rasheed @ 2019-04-02 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/db4bc99948bf746c7035b49cc581eb1c44a30788 Modified Files -------------- src/backend/rewrite/rowsecurity.c | 8 ++++++++ src/test/regress/expected/rowsecurity.out | 27 +++++++++++++++++++++++++++ src/test/regress/sql/rowsecurity.sql | 26 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Perform RLS subquery checks as the right user when going via a v @ 2019-04-02 07:31 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 5+ messages in thread From: Dean Rasheed @ 2019-04-02 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1b9a2f458b36747db07aff6631ade56c24cfda03 Modified Files -------------- src/backend/rewrite/rowsecurity.c | 8 ++++++++ src/test/regress/expected/rowsecurity.out | 27 +++++++++++++++++++++++++++ src/test/regress/sql/rowsecurity.sql | 26 ++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
* pgsql: Perform RLS subquery checks as the right user when going via a v @ 2019-04-02 07:31 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 5+ messages in thread From: Dean Rasheed @ 2019-04-02 07:31 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org 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 Branch ------ REL9_5_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2e606d0ad7984c15f323eacfc333990b93683cc7 Modified Files -------------- src/backend/rewrite/rowsecurity.c | 8 ++++++++ src/test/regress/expected/rowsecurity.out | 31 +++++++++++++++++++++++++++++++ src/test/regress/sql/rowsecurity.sql | 31 +++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) ^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2019-04-02 07:31 UTC | newest] Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2019-04-02 07:31 pgsql: Perform RLS subquery checks as the right user when going via a v Dean Rasheed <dean.a.rasheed@gmail.com> 2019-04-02 07:31 pgsql: Perform RLS subquery checks as the right user when going via a v Dean Rasheed <dean.a.rasheed@gmail.com> 2019-04-02 07:31 pgsql: Perform RLS subquery checks as the right user when going via a v Dean Rasheed <dean.a.rasheed@gmail.com> 2019-04-02 07:31 pgsql: Perform RLS subquery checks as the right user when going via a v Dean Rasheed <dean.a.rasheed@gmail.com> 2019-04-02 07:31 pgsql: Perform RLS subquery checks as the right user when going via a v Dean Rasheed <dean.a.rasheed@gmail.com>
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