- Notifications
You must be signed in to change notification settings - Fork5
Commit6550b90
committed
Code review for row security.
Buildfarm member tick identified an issue where the policies in therelcache for a relation were were being replaced underneath a runningquery, leading to segfaults while processing the policies to be addedto a query. Similar to how TupleDesc RuleLocks are handled, add in aequalRSDesc() function to check if the policies have actually changedand, if not, swap back the rsdesc field (using the original instead ofthe temporairly built one; the whole structure is swapped and thenspecific fields swapped back). This now passes a CLOBBER_CACHE_ALWAYSfor me and should resolve the buildfarm error.In addition to addressing this, add a new chapter in Data Definitionunder Privileges which explains row security and provides examples ofits usage, change \d to always list policies (even if row security isdisabled- but note that it is disabled, or enabled with no policies),rework check_role_for_policy (it really didn't need the entire policy,but it did need to be using has_privs_of_role()), and change the fieldin pg_class to relrowsecurity from relhasrowsecurity, based onHeikki's suggestion. Also from Heikki, only issue SET ROW_SECURITY inpg_restore when talking to a 9.5+ server, list Bypass RLS in \du, anddocument --enable-row-security options for pg_dump and pg_restore.Lastly, fix a number of minor whitespace and typo issues from Heikki,Dimitri, add a missing #include, per Peter E, fix a few minorvariable-assigned-but-not-used and resource leak issues from Coverityand add tab completion for role attribute bypassrls as well.1 parent3f6f926 commit6550b90
File tree
24 files changed
+439
-122
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- rewrite
- utils
- adt
- cache
- bin
- pg_dump
- psql
- include
- catalog
- commands
- test/regress/expected
24 files changed
+439
-122
lines changedLines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1941 | 1941 |
| |
1942 | 1942 |
| |
1943 | 1943 |
| |
1944 |
| - | |
| 1944 | + | |
1945 | 1945 |
| |
| 1946 | + | |
1946 | 1947 |
| |
1947 | 1948 |
| |
1948 | 1949 |
| |
| |||
5415 | 5416 |
| |
5416 | 5417 |
| |
5417 | 5418 |
| |
5418 |
| - | |
| 5419 | + | |
5419 | 5420 |
| |
5420 | 5421 |
| |
5421 | 5422 |
| |
| |||
9228 | 9229 |
| |
9229 | 9230 |
| |
9230 | 9231 |
| |
9231 |
| - | |
| 9232 | + | |
9232 | 9233 |
| |
9233 |
| - | |
9234 |
| - | |
| 9234 | + | |
| 9235 | + | |
9235 | 9236 |
| |
9236 | 9237 |
| |
9237 | 9238 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5457 | 5457 |
| |
5458 | 5458 |
| |
5459 | 5459 |
| |
5460 |
| - | |
| 5460 | + | |
5461 | 5461 |
| |
5462 |
| - | |
| 5462 | + | |
5463 | 5463 |
| |
5464 | 5464 |
| |
5465 | 5465 |
| |
|
Lines changed: 168 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1508 | 1508 |
| |
1509 | 1509 |
| |
1510 | 1510 |
| |
| 1511 | + | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
| 1584 | + | |
| 1585 | + | |
| 1586 | + | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
1511 | 1679 |
| |
1512 | 1680 |
| |
1513 | 1681 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
429 | 429 |
| |
430 | 430 |
| |
431 | 431 |
| |
432 |
| - | |
| 432 | + | |
433 | 433 |
| |
434 | 434 |
| |
435 | 435 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
240 | 240 |
| |
241 | 241 |
| |
242 | 242 |
| |
243 |
| - | |
| 243 | + | |
244 | 244 |
| |
245 | 245 |
| |
246 | 246 |
| |
|
Lines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
687 | 687 |
| |
688 | 688 |
| |
689 | 689 |
| |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
690 | 707 |
| |
691 | 708 |
| |
692 | 709 |
| |
|
Lines changed: 23 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
490 | 490 |
| |
491 | 491 |
| |
492 | 492 |
| |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
493 | 516 |
| |
494 | 517 |
| |
495 | 518 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
799 | 799 |
| |
800 | 800 |
| |
801 | 801 |
| |
802 |
| - | |
| 802 | + | |
803 | 803 |
| |
804 | 804 |
| |
805 | 805 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
119 | 119 |
| |
120 | 120 |
| |
121 | 121 |
| |
122 |
| - | |
| 122 | + | |
123 | 123 |
| |
124 | 124 |
| |
125 | 125 |
| |
|
Lines changed: 8 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
111 |
| - | |
| 111 | + | |
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
| |||
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
124 |
| - | |
125 |
| - | |
| 124 | + | |
126 | 125 |
| |
127 | 126 |
| |
128 | 127 |
| |
| |||
422 | 421 |
| |
423 | 422 |
| |
424 | 423 |
| |
425 |
| - | |
426 |
| - | |
| 424 | + | |
| 425 | + | |
427 | 426 |
| |
428 | 427 |
| |
429 | 428 |
| |
| |||
484 | 483 |
| |
485 | 484 |
| |
486 | 485 |
| |
487 |
| - | |
| 486 | + | |
488 | 487 |
| |
489 | 488 |
| |
490 | 489 |
| |
| |||
731 | 730 |
| |
732 | 731 |
| |
733 | 732 |
| |
734 |
| - | |
| 733 | + | |
735 | 734 |
| |
736 | 735 |
| |
737 | 736 |
| |
| |||
850 | 849 |
| |
851 | 850 |
| |
852 | 851 |
| |
853 |
| - | |
| 852 | + | |
854 | 853 |
| |
855 | 854 |
| |
856 | 855 |
| |
| |||
868 | 867 |
| |
869 | 868 |
| |
870 | 869 |
| |
871 |
| - | |
| 870 | + | |
872 | 871 |
| |
873 | 872 |
| |
874 | 873 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10647 | 10647 |
| |
10648 | 10648 |
| |
10649 | 10649 |
| |
10650 |
| - | |
| 10650 | + | |
10651 | 10651 |
| |
10652 | 10652 |
| |
10653 | 10653 |
| |
| |||
10674 | 10674 |
| |
10675 | 10675 |
| |
10676 | 10676 |
| |
10677 |
| - | |
| 10677 | + | |
10678 | 10678 |
| |
10679 | 10679 |
| |
10680 | 10680 |
| |
|
0 commit comments
Comments
(0)