PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/parallel.h"
#include "catalog/dependency.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_proc.h"
#include "executor/executor.h"
#include "fmgr.h"
#include "miscadmin.h"
#include "tcop/utility.h"
Go to the source code of this file.
Functions | |
static void | REGRESS_object_access_hook_str (ObjectAccessType access, Oid classId, const char *objName, int subId, void *arg) |
static void | REGRESS_object_access_hook (ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg) |
static bool | REGRESS_exec_check_perms (List *rangeTabls, List *rteperminfos, bool do_abort) |
static void | REGRESS_utility_command (PlannedStmt *pstmt, const char *queryString, bool readOnlyTree, ProcessUtilityContext context, ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest, QueryCompletion *qc) |
static char * | accesstype_to_string (ObjectAccessType access, int subId) |
static char * | accesstype_arg_to_string (ObjectAccessType access, void *arg) |
void | _PG_init (void) |
static void | emit_audit_message (const char *type, const char *hook, char *action, char *objName) |
static void | audit_attempt (const char *hook, char *action, char *objName) |
static void | audit_success (const char *hook, char *action, char *objName) |
static void | audit_failure (const char *hook, char *action, char *objName) |
Variables | |
PG_MODULE_MAGIC | |
static bool | REGRESS_deny_set_variable = false |
static bool | REGRESS_deny_alter_system = false |
static bool | REGRESS_deny_object_access = false |
static bool | REGRESS_deny_exec_perms = false |
static bool | REGRESS_deny_utility_commands = false |
static bool | REGRESS_audit = false |
static bool | REGRESS_userset_variable1 = false |
static bool | REGRESS_userset_variable2 = false |
static bool | REGRESS_suset_variable1 = false |
static bool | REGRESS_suset_variable2 = false |
static object_access_hook_type | next_object_access_hook = NULL |
static object_access_hook_type_str | next_object_access_hook_str = NULL |
static ExecutorCheckPerms_hook_type | next_exec_check_perms_hook = NULL |
static ProcessUtility_hook_type | next_ProcessUtility_hook = NULL |
void _PG_init | ( | void | ) |
Definition at line 75 of file test_oat_hooks.c.
References DefineCustomBoolVariable(), ExecutorCheckPerms_hook, GUC_NOT_IN_SAMPLE, MarkGUCPrefixReserved(), next_exec_check_perms_hook, next_object_access_hook, next_object_access_hook_str, next_ProcessUtility_hook, object_access_hook, object_access_hook_str, PGC_SUSET, PGC_USERSET, ProcessUtility_hook, REGRESS_audit, REGRESS_deny_alter_system, REGRESS_deny_exec_perms, REGRESS_deny_object_access, REGRESS_deny_set_variable, REGRESS_deny_utility_commands, REGRESS_exec_check_perms(), REGRESS_object_access_hook(), REGRESS_object_access_hook_str(), REGRESS_suset_variable1, REGRESS_suset_variable2, REGRESS_userset_variable1, REGRESS_userset_variable2, and REGRESS_utility_command().
|
static |
Definition at line 458 of file test_oat_hooks.c.
References arg, ObjectAccessPostAlter::auxiliary_id, ObjectAccessDrop::dropflags, ObjectAccessNamespaceSearch::ereport_on_violation, ObjectAccessPostCreate::is_internal, ObjectAccessPostAlter::is_internal, OAT_DROP, OAT_FUNCTION_EXECUTE, OAT_NAMESPACE_SEARCH, OAT_POST_ALTER, OAT_POST_CREATE, OAT_TRUNCATE, OidIsValid, PERFORM_DELETION_CONCURRENT_LOCK, PERFORM_DELETION_CONCURRENTLY, PERFORM_DELETION_INTERNAL, PERFORM_DELETION_QUIETLY, PERFORM_DELETION_SKIP_EXTENSIONS, PERFORM_DELETION_SKIP_ORIGINAL, psprintf(), pstrdup(), and ObjectAccessNamespaceSearch::result.
Referenced by REGRESS_object_access_hook().
|
static |
Definition at line 419 of file test_oat_hooks.c.
References ACL_ALTER_SYSTEM, ACL_SET, OAT_DROP, OAT_FUNCTION_EXECUTE, OAT_NAMESPACE_SEARCH, OAT_POST_ALTER, OAT_POST_CREATE, OAT_TRUNCATE, psprintf(), and type.
Referenced by REGRESS_object_access_hook(), and REGRESS_object_access_hook_str().
|
static |
Definition at line 259 of file test_oat_hooks.c.
References generate_unaccent_rules::action, and emit_audit_message().
Referenced by REGRESS_exec_check_perms(), REGRESS_object_access_hook(), REGRESS_object_access_hook_str(), and REGRESS_utility_command().
|
static |
Definition at line 271 of file test_oat_hooks.c.
References generate_unaccent_rules::action, and emit_audit_message().
Referenced by REGRESS_exec_check_perms().
|
static |
Definition at line 265 of file test_oat_hooks.c.
References generate_unaccent_rules::action, and emit_audit_message().
Referenced by REGRESS_exec_check_perms(), REGRESS_object_access_hook(), REGRESS_object_access_hook_str(), and REGRESS_utility_command().
|
static |
Definition at line 231 of file test_oat_hooks.c.
References generate_unaccent_rules::action, ereport, errcode(), errmsg(), GetUserId(), IsParallelWorker, NOTICE, pfree(), REGRESS_audit, superuser_arg(), and type.
Referenced by audit_attempt(), audit_failure(), and audit_success().
|
static |
Definition at line 348 of file test_oat_hooks.c.
References audit_attempt(), audit_failure(), audit_success(), ereport, errcode(), errmsg(), ERROR, GetUserId(), next_exec_check_perms_hook, pstrdup(), REGRESS_deny_exec_perms, and superuser_arg().
Referenced by _PG_init().
|
static |
Definition at line 325 of file test_oat_hooks.c.
References accesstype_arg_to_string(), accesstype_to_string(), arg, audit_attempt(), audit_success(), ereport, errcode(), errmsg(), ERROR, GetUserId(), next_object_access_hook, REGRESS_deny_object_access, and superuser_arg().
Referenced by _PG_init().
|
static |
Definition at line 277 of file test_oat_hooks.c.
References accesstype_to_string(), ACL_ALTER_SYSTEM, ACL_SET, arg, audit_attempt(), audit_success(), elog, ereport, errcode(), errmsg(), ERROR, GetUserId(), next_object_access_hook_str, OAT_POST_ALTER, pstrdup(), REGRESS_deny_alter_system, REGRESS_deny_set_variable, and superuser_arg().
Referenced by _PG_init().
|
static |
Definition at line 380 of file test_oat_hooks.c.
References generate_unaccent_rules::action, audit_attempt(), audit_success(), context, CreateCommandTag(), generate_unaccent_rules::dest, ereport, errcode(), errmsg(), ERROR, GetCommandTagName(), GetUserId(), next_ProcessUtility_hook, pstrdup(), REGRESS_deny_utility_commands, standard_ProcessUtility(), superuser_arg(), and PlannedStmt::utilityStmt.
Referenced by _PG_init().
|
static |
Definition at line 49 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_exec_check_perms().
|
static |
Definition at line 47 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_object_access_hook().
|
static |
Definition at line 48 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_object_access_hook_str().
|
static |
Definition at line 50 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_utility_command().
PG_MODULE_MAGIC |
Definition at line 25 of file test_oat_hooks.c.
Definition at line 35 of file test_oat_hooks.c.
Referenced by _PG_init(), and emit_audit_message().
Definition at line 31 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_object_access_hook_str().
Definition at line 33 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_exec_check_perms().
Definition at line 32 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_object_access_hook().
Definition at line 30 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_object_access_hook_str().
Definition at line 34 of file test_oat_hooks.c.
Referenced by _PG_init(), and REGRESS_utility_command().
Definition at line 43 of file test_oat_hooks.c.
Referenced by _PG_init().
Definition at line 44 of file test_oat_hooks.c.
Referenced by _PG_init().
Definition at line 41 of file test_oat_hooks.c.
Referenced by _PG_init().
Definition at line 42 of file test_oat_hooks.c.
Referenced by _PG_init().