summaryrefslogtreecommitdiff
path: root/src/include/miscadmin.h
diff options
context:
space:
mode:
authorNathan Bossart2023-07-14 04:10:36 +0000
committerNathan Bossart2023-07-14 04:10:36 +0000
commit9987a7bf34061ed5cffc4e5113da056358976e94 (patch)
tree07fc348fd3ef1c4ddf2e99fdf0319c9b49fd6ba8 /src/include/miscadmin.h
parentedca3424342da323499a1998d18a888283e52ac7 (diff)
Move privilege check for SET SESSION AUTHORIZATION.
Presently, the privilege check for SET SESSION AUTHORIZATION is performed in session_authorization's assign_hook. A relevant comment states, "It's OK because the check does not require catalog access and can't fail during an end-of-transaction GUC reversion..." However, we plan to add a catalog lookup to this privilege check in a follow-up commit. This commit moves this privilege check to the check_hook for session_authorization. Like check_role(), we do not throw a hard error for insufficient privileges when the source is PGC_S_TEST. 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, 1 insertions, 0 deletions
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index 14bd574fc24..11d6e6869de 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -357,6 +357,7 @@ 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);