PostgreSQL Source Code
git master
usercontext.h
Go to the documentation of this file.
1
/*-------------------------------------------------------------------------
2
*
3
* usercontext.h
4
* Convenience functions for running code as a different database user.
5
*
6
*-------------------------------------------------------------------------
7
*/
8
#ifndef USERCONTEXT_H
9
#define USERCONTEXT_H
10
11
/*
12
* When temporarily changing to run as a different user, this structure
13
* holds the details needed to restore the original state.
14
*/
15
typedef
struct
UserContext
16
{
17
Oid
save_userid
;
18
int
save_sec_context
;
19
int
save_nestlevel
;
20
}
UserContext
;
21
22
/* Function prototypes. */
23
extern
void
SwitchToUntrustedUser
(
Oid
userid,
UserContext
*
context
);
24
extern
void
RestoreUserContext
(
UserContext
*
context
);
25
26
#endif
/* USERCONTEXT_H */
Oid
unsigned int Oid
Definition:
postgres_ext.h:31
context
tree context
Definition:
radixtree.h:1835
UserContext
Definition:
usercontext.h:16
UserContext::save_sec_context
int save_sec_context
Definition:
usercontext.h:18
UserContext::save_userid
Oid save_userid
Definition:
usercontext.h:17
UserContext::save_nestlevel
int save_nestlevel
Definition:
usercontext.h:19
SwitchToUntrustedUser
void SwitchToUntrustedUser(Oid userid, UserContext *context)
Definition:
usercontext.c:33
RestoreUserContext
void RestoreUserContext(UserContext *context)
Definition:
usercontext.c:87
UserContext
struct UserContext UserContext
src
include
utils
usercontext.h
Generated on Sun Sep 8 2024 00:13:25 for PostgreSQL Source Code by
1.9.1