Commit a0363ab
committed
Fix privilege check for SET SESSION AUTHORIZATION.
Presently, the privilege check for SET SESSION AUTHORIZATION checks
whether the original authenticated role was a superuser at
connection start time. Even if the role loses the superuser
attribute, its existing sessions are permitted to change session
authorization to any role.
This commit modifies this privilege check to verify the original
authenticated role currently has superuser. In the event that the
authenticated role loses superuser within a session authorization
change, the authorization change will remain in effect, which means
the user can still take advantage of the target role's privileges.
However, [RE]SET SESSION AUTHORIZATION will only permit switching
to the original authenticated role.
Author: Joseph Koshakow
Discussion: https://postgr.es/m/CAAvxfHc-HHzONQ2oXdvhFF9ayRnidPwK%2BfVBhRzaBWYYLVQL-g%40mail.gmail.com1 parent 9987a7b commit a0363ab
File tree
4 files changed
+10
-23
lines changed- doc/src/sgml/ref
- src
- backend
- commands
- utils/init
- include
4 files changed
+10
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
| 857 | + | |
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
470 | | - | |
471 | | - | |
| 470 | + | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| |||
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
495 | | - | |
496 | | - | |
| 495 | + | |
497 | 496 | | |
498 | 497 | | |
499 | 498 | | |
| |||
582 | 581 | | |
583 | 582 | | |
584 | 583 | | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | 584 | | |
596 | 585 | | |
597 | 586 | | |
| |||
741 | 730 | | |
742 | 731 | | |
743 | 732 | | |
| 733 | + | |
744 | 734 | | |
745 | 735 | | |
746 | 736 | | |
| |||
780 | 770 | | |
781 | 771 | | |
782 | 772 | | |
783 | | - | |
| 773 | + | |
784 | 774 | | |
785 | 775 | | |
786 | | - | |
| 776 | + | |
787 | 777 | | |
788 | 778 | | |
789 | 779 | | |
| |||
816 | 806 | | |
817 | 807 | | |
818 | 808 | | |
819 | | - | |
| 809 | + | |
820 | 810 | | |
821 | 811 | | |
822 | 812 | | |
| |||
828 | 818 | | |
829 | 819 | | |
830 | 820 | | |
831 | | - | |
| 821 | + | |
832 | 822 | | |
833 | 823 | | |
834 | 824 | | |
| |||
851 | 841 | | |
852 | 842 | | |
853 | 843 | | |
854 | | - | |
855 | | - | |
856 | 844 | | |
857 | 845 | | |
858 | 846 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | 360 | | |
362 | 361 | | |
363 | 362 | | |
| |||
0 commit comments