- Notifications
You must be signed in to change notification settings - Fork28
Commit92b1522
committed
RLS: Fix ALL vs. SELECT+UPDATE policy usage
When we add the SELECT-privilege based policies to the RLS with checkoptions (such as for an UPDATE statement, or when we have INSERT ...RETURNING), we need to be sure and use the 'USING' case if the policy isactually an 'ALL' policy (which could have both a USING clause and anindependent WITH CHECK clause).This could result in policies acting differently when built using ALL(when the ALL had both USING and WITH CHECK clauses) and when buildingthe policies independently as SELECT and UPDATE policies.Fix this by adding an explicit boolean to add_with_check_options() toindicate when the USING policy should be used, even if the policy hasboth USING and WITH CHECK policies on it.Reported by: Rod TaylorBack-patch to 9.5 where RLS was introduced.1 parenta24a1a2 commit92b1522
1 file changed
+15
-8
lines changedLines changed: 15 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
81 |
| - | |
| 81 | + | |
| 82 | + | |
82 | 83 |
| |
83 | 84 |
| |
84 | 85 |
| |
| |||
271 | 272 |
| |
272 | 273 |
| |
273 | 274 |
| |
274 |
| - | |
| 275 | + | |
| 276 | + | |
275 | 277 |
| |
276 | 278 |
| |
277 | 279 |
| |
| |||
294 | 296 |
| |
295 | 297 |
| |
296 | 298 |
| |
297 |
| - | |
| 299 | + | |
| 300 | + | |
298 | 301 |
| |
299 | 302 |
| |
300 | 303 |
| |
| |||
323 | 326 |
| |
324 | 327 |
| |
325 | 328 |
| |
326 |
| - | |
| 329 | + | |
| 330 | + | |
327 | 331 |
| |
328 | 332 |
| |
329 | 333 |
| |
| |||
345 | 349 |
| |
346 | 350 |
| |
347 | 351 |
| |
348 |
| - | |
| 352 | + | |
| 353 | + | |
349 | 354 |
| |
350 | 355 |
| |
351 | 356 |
| |
| |||
354 | 359 |
| |
355 | 360 |
| |
356 | 361 |
| |
357 |
| - | |
| 362 | + | |
| 363 | + | |
358 | 364 |
| |
359 | 365 |
| |
360 | 366 |
| |
| |||
645 | 651 |
| |
646 | 652 |
| |
647 | 653 |
| |
648 |
| - | |
| 654 | + | |
| 655 | + | |
649 | 656 |
| |
650 | 657 |
| |
651 | 658 |
| |
652 | 659 |
| |
653 | 660 |
| |
654 |
| - | |
| 661 | + | |
655 | 662 |
| |
656 | 663 |
| |
657 | 664 |
| |
|
0 commit comments
Comments
(0)