mirror of
https://github.com/postgres/postgres.git
synced 2025-07-05 07:21:24 +03:00
Allow plugins to suppress inlining and hook function entry/exit/abort.
This is intended as infrastructure to allow an eventual SE-Linux plugin to support trusted procedures. KaiGai Kohei
This commit is contained in:
@ -3726,6 +3726,10 @@ inline_function(Oid funcid, Oid result_type, List *args,
|
||||
if (pg_proc_aclcheck(funcid, GetUserId(), ACL_EXECUTE) != ACLCHECK_OK)
|
||||
return NULL;
|
||||
|
||||
/* Check whether a plugin wants to hook function entry/exit */
|
||||
if (FmgrHookIsNeeded(funcid))
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* Make a temporary memory context, so that we don't leak all the stuff
|
||||
* that parsing might create.
|
||||
@ -4158,6 +4162,10 @@ inline_set_returning_function(PlannerInfo *root, RangeTblEntry *rte)
|
||||
if (pg_proc_aclcheck(func_oid, GetUserId(), ACL_EXECUTE) != ACLCHECK_OK)
|
||||
return NULL;
|
||||
|
||||
/* Check whether a plugin wants to hook function entry/exit */
|
||||
if (FmgrHookIsNeeded(func_oid))
|
||||
return NULL;
|
||||
|
||||
/*
|
||||
* OK, let's take a look at the function's pg_proc entry.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user