- Notifications
You must be signed in to change notification settings - Fork28
Commit157dcf5
committed
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 areperformed as the view owner. However, the code neglected to propagatethat to any subqueries in the RLS checks. Fix that by callingsetRuleCheckAsUser() for all RLS policy quals and withCheckOptionchecks 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.org1 parentab7590e commit157dcf5
File tree
3 files changed
+61
-0
lines changed- src
- backend/rewrite
- test/regress
- expected
- sql
3 files changed
+61
-0
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| 50 | + | |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
| |||
381 | 382 |
| |
382 | 383 |
| |
383 | 384 |
| |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
384 | 392 |
| |
385 | 393 |
| |
386 | 394 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3911 | 3911 |
| |
3912 | 3912 |
| |
3913 | 3913 |
| |
| 3914 | + | |
| 3915 | + | |
| 3916 | + | |
| 3917 | + | |
| 3918 | + | |
| 3919 | + | |
| 3920 | + | |
| 3921 | + | |
| 3922 | + | |
| 3923 | + | |
| 3924 | + | |
| 3925 | + | |
| 3926 | + | |
| 3927 | + | |
| 3928 | + | |
| 3929 | + | |
| 3930 | + | |
| 3931 | + | |
| 3932 | + | |
| 3933 | + | |
| 3934 | + | |
| 3935 | + | |
| 3936 | + | |
| 3937 | + | |
| 3938 | + | |
| 3939 | + | |
| 3940 | + | |
3914 | 3941 |
| |
3915 | 3942 |
| |
3916 | 3943 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1767 | 1767 |
| |
1768 | 1768 |
| |
1769 | 1769 |
| |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
1770 | 1796 |
| |
1771 | 1797 |
| |
1772 | 1798 |
| |
|
0 commit comments
Comments
(0)