Skip to content

Commit 2c3c5ec

Browse files
committed
Set GUC "is_superuser" in all processes that set AuthenticatedUserId.
It was always false in single-user mode, in autovacuum workers, and in background workers. This had no specifically-identified security consequences, but non-core code or future work might make it security-relevant. Back-patch to v11 (all supported versions). Jelte Fennema-Nio. Reported by Jelte Fennema-Nio.
1 parent 7854127 commit 2c3c5ec

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/utils/init/miscinit.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,14 @@ InitializeSessionUserIdStandalone(void)
844844
AuthenticatedUserIsSuperuser = true;
845845

846846
SetSessionUserId(BOOTSTRAP_SUPERUSERID, true);
847+
848+
/*
849+
* XXX This should set SetConfigOption("session_authorization"), too.
850+
* Since we don't, C code will get NULL, and current_setting() will get an
851+
* empty string.
852+
*/
853+
SetConfigOption("is_superuser", "on",
854+
PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT);
847855
}
848856

849857
/*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy