add standard_ProcessUtility hook

This commit is contained in:
chenxiaobin19
2022-09-02 11:54:59 +08:00
parent 7912920cb9
commit 565c997ab4
7 changed files with 19 additions and 37 deletions

View File

@ -97,7 +97,6 @@ PG_MODULE_MAGIC;
extern "C" void _PG_init(void);
extern "C" void _PG_fini(void);
extern "C" void set_gsaudit_prehook(ProcessUtility_hook_type func);
#define POLICY_STR_BUFF_LEN 512
#define POLICY_TMP_BUFF_LEN 256
@ -1782,7 +1781,7 @@ void install_audit_hook()
* preserve the chains.
*/
next_ExecutorStart_hook = ExecutorStart_hook;
set_gsaudit_prehook(ProcessUtility_hook);
next_ProcessUtility_hook = ProcessUtility_hook;
/*
* Install audit hooks, the interface for GaussDB kernel user as below
@ -1822,15 +1821,6 @@ void install_label_hook()
}
}
/*
* This function is used for setting prev_ProcessUtility to rewrite
* standard_ProcessUtility by other extension.
*/
void set_gsaudit_prehook(ProcessUtility_hook_type func)
{
next_ProcessUtility_hook = func;
}
/*
* Define GUC variables and install hooks upon module load.
* NOTE: _PG_init will be invoked(installed) many times