pgsql: Perform RLS subquery checks as the right user when going via av

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема pgsql: Perform RLS subquery checks as the right user when going via av
Дата
Msg-id E1hBDtY-0003xJ-BQ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: pgsql: Add progress reporting to pg_checksums
Следующее
От: Etsuro Fujita
Дата:
Сообщение: pgsql: postgres_fdw: Perform the (ORDERED,NULL) upperrel operations re