summaryrefslogtreecommitdiff
path: root/src/include/miscadmin.h
diff options
context:
space:
mode:
authorNathan Bossart2023-07-14 04:13:45 +0000
committerNathan Bossart2023-07-14 04:13:45 +0000
commita0363ab7aafda7d16ae59e72d86866c02ad3d657 (patch)
treeb682bf6ca6b4a56e17f03a4f5b9f12fcb4f9b86a /src/include/miscadmin.h
parent9987a7bf34061ed5cffc4e5113da056358976e94 (diff)
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.com
Diffstat (limited to 'src/include/miscadmin.h')
-rw-r--r--src/include/miscadmin.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 11d6e6869de..14bd574fc24 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -357,7 +357,6 @@ extern Oid GetUserId(void);
extern Oid GetOuterUserId(void);
extern Oid GetSessionUserId(void);
extern Oid GetAuthenticatedUserId(void);
-extern bool GetAuthenticatedUserIsSuperuser(void);
extern void GetUserIdAndSecContext(Oid *userid, int *sec_context);
extern void SetUserIdAndSecContext(Oid userid, int sec_context);
extern bool InLocalUserIdChange(void);