Skip to content

Commit 9e9f9ca

Browse files
anju15bhartiANJU BHARTI
authored and
ANJU BHARTI
committed
fix: correct behavior of cross-database table valued functions (babelfish-for-postgresql#583)
Added missing hook for tabled valued function execution to check privilege against login instead of your user. Extension PR: babelfish-for-postgresql/babelfish_extensions#3802 Task: BABEL-5792 Signed-off-by: ANJU BHARTI <[email protected]>
1 parent 5362a52 commit 9e9f9ca

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/executor/execSRF.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "catalog/objectaccess.h"
2323
#include "catalog/pg_proc.h"
2424
#include "executor/execdebug.h"
25+
#include "executor/execExpr.h"
2526
#include "funcapi.h"
2627
#include "miscadmin.h"
2728
#include "nodes/nodeFuncs.h"
@@ -702,7 +703,10 @@ init_sexpr(Oid foid, Oid input_collation, Expr *node,
702703
size_t numargs = list_length(sexpr->args);
703704

704705
/* Check permission to call function */
705-
aclresult = object_aclcheck(ProcedureRelationId, foid, GetUserId(), ACL_EXECUTE);
706+
if (ExecFuncProc_AclCheck_hook)
707+
aclresult = ExecFuncProc_AclCheck_hook(foid);
708+
else
709+
aclresult = object_aclcheck(ProcedureRelationId, foid, GetUserId(), ACL_EXECUTE);
706710
if (aclresult != ACLCHECK_OK)
707711
aclcheck_error(aclresult, OBJECT_FUNCTION, get_func_name(foid));
708712
InvokeFunctionExecuteHook(foid);

0 commit comments

Comments
 (0)