summaryrefslogtreecommitdiff
path: root/src/pl/tcl
diff options
context:
space:
mode:
authorPeter Eisentraut2022-11-13 07:11:17 +0000
committerPeter Eisentraut2022-11-13 08:02:41 +0000
commitc727f511bd7bf3c58063737bcf7a8f331346f253 (patch)
treef59a013d0e7fe8b086eab5810b941de27695fe2d /src/pl/tcl
parentafbfc02983f86c4d71825efa6befd547fe81a926 (diff)
Refactor aclcheck functions
Instead of dozens of mostly-duplicate pg_foo_aclcheck() functions, write one common function object_aclcheck() that can handle almost all of them. We already have all the information we need, such as which system catalog corresponds to which catalog table and which column is the ACL column. There are a few pg_foo_aclcheck() that don't work via the generic function and have special APIs, so those stay as is. I also changed most pg_foo_aclmask() functions to static functions, since they are not used outside of aclchk.c. Reviewed-by: Corey Huinker <[email protected]> Reviewed-by: Antonin Houska <[email protected]> Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Diffstat (limited to 'src/pl/tcl')
-rw-r--r--src/pl/tcl/pltcl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index eaa98d42c2e..4185fb12210 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -619,7 +619,7 @@ call_pltcl_start_proc(Oid prolang, bool pltrusted)
procOid = LookupFuncName(namelist, 0, NULL, false);
/* Current user must have permission to call function */
- aclresult = pg_proc_aclcheck(procOid, GetUserId(), ACL_EXECUTE);
+ aclresult = object_aclcheck(ProcedureRelationId, procOid, GetUserId(), ACL_EXECUTE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, OBJECT_FUNCTION, start_proc);