Skip to content

Commit 1a6de07

Browse files
committed
Check SELECT permissions in subqueries.
1 parent 472d802 commit 1a6de07

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/backend/executor/execMain.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
*
2828
* IDENTIFICATION
29-
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.44 1998/02/26 04:31:09 momjian Exp $
29+
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.45 1998/02/27 08:43:52 vadim Exp $
3030
*
3131
*-------------------------------------------------------------------------
3232
*/
@@ -54,12 +54,12 @@
5454
#include "catalog/heap.h"
5555
#include "commands/trigger.h"
5656

57+
void
58+
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
59+
Query *parseTree);
5760

5861

5962
/* decls for local routines only used within this module */
60-
static void
61-
ExecCheckPerms(CmdType operation, int resultRelation, List *rangeTable,
62-
Query *parseTree);
6363
static TupleDesc
6464
InitPlan(CmdType operation, Query *parseTree,
6565
Plan *plan, EState *estate);
@@ -273,14 +273,7 @@ ExecutorEnd(QueryDesc *queryDesc, EState *estate)
273273
BufferRefCountRestore(estate->es_refcount);
274274
}
275275

276-
/* ===============================================================
277-
* ===============================================================
278-
static routines follow
279-
* ===============================================================
280-
* ===============================================================
281-
*/
282-
283-
static void
276+
void
284277
ExecCheckPerms(CmdType operation,
285278
int resultRelation,
286279
List *rangeTable,
@@ -376,6 +369,13 @@ ExecCheckPerms(CmdType operation,
376369
}
377370
}
378371

372+
/* ===============================================================
373+
* ===============================================================
374+
static routines follow
375+
* ===============================================================
376+
* ===============================================================
377+
*/
378+
379379

380380
/* ----------------------------------------------------------------
381381
* InitPlan

src/backend/executor/nodeSubplan.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,14 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext)
106106
*
107107
* ----------------------------------------------------------------
108108
*/
109+
extern void ExecCheckPerms(CmdType op, int resRel, List *rtable, Query *q);
109110
bool
110111
ExecInitSubPlan(SubPlan *node, EState *estate, Plan *parent)
111112
{
112113
EState *sp_estate = CreateExecutorState();
113114

115+
ExecCheckPerms (CMD_SELECT, 0, node->rtable, (Query*) NULL);
116+
114117
sp_estate->es_range_table = node->rtable;
115118
sp_estate->es_param_list_info = estate->es_param_list_info;
116119
sp_estate->es_param_exec_vals = estate->es_param_exec_vals;

0 commit comments

Comments
 (0)