Fix per-session activation of ALTER {ROLE|DATABASE} SET role.
authorNoah Misch <[email protected]>
Sat, 16 Nov 2024 04:39:56 +0000 (20:39 -0800)
committerNoah Misch <[email protected]>
Sat, 16 Nov 2024 04:40:00 +0000 (20:40 -0800)
commit07c6e0f613612ff060572a085c1c24aa44c8b2bb
tree6150cf281e20c0382c431b8d6be15a7dc8b10840
parent15dc1abb17ddb4bba3025302d0b71b9325258601
Fix per-session activation of ALTER {ROLE|DATABASE} SET role.

After commit 5a2fed911a85ed6d8a015a6bafe3a0d9a69334ae, the catalog state
resulting from these commands ceased to affect sessions.  Restore the
longstanding behavior, which is like beginning the session with a SET
ROLE command.  If cherry-picking the CVE-2024-10978 fixes, default to
including this, too.  (This fixes an unintended side effect of fixing
CVE-2024-10978.)  Back-patch to v12, like that commit.  The release team
decided to include v12, despite the original intent to halt v12 commits
earlier this week.

Tom Lane and Noah Misch.  Reported by Etienne LAFARGE.

Discussion: https://postgr.es/m/CADOZwSb0UsEr4_UTFXC5k7=fyyK8uKXekucd+-uuGjJsGBfxgw@mail.gmail.com
src/backend/utils/init/miscinit.c
src/backend/utils/misc/guc.c
src/test/modules/unsafe_tests/Makefile
src/test/modules/unsafe_tests/expected/setconfig.out [new file with mode: 0644]
src/test/modules/unsafe_tests/sql/setconfig.sql [new file with mode: 0644]