hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hubertzh...@apache.org
Subject incubator-hawq git commit: HAWQ-1239. Fail to call pg_rangercheck_batch() when when 'rte->rtekind != RTE_RELATION' or 'requiredPerms == 0'
Date Wed, 28 Dec 2016 09:22:45 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 4ca158740 -> cee573ad4


HAWQ-1239. Fail to call pg_rangercheck_batch() when when 'rte->rtekind != RTE_RELATION'
or 'requiredPerms == 0'


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/cee573ad
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/cee573ad
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/cee573ad

Branch: refs/heads/master
Commit: cee573ad418a6e27a1cb13c66958a661af822e74
Parents: 4ca1587
Author: Chunling Wang <wangchunling14@126.com>
Authored: Tue Dec 27 17:52:56 2016 +0800
Committer: hzhang2 <zhanghuan929@163.com>
Committed: Wed Dec 28 17:22:20 2016 +0800

----------------------------------------------------------------------
 src/backend/parser/parse_relation.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cee573ad/src/backend/parser/parse_relation.c
----------------------------------------------------------------------
diff --git a/src/backend/parser/parse_relation.c b/src/backend/parser/parse_relation.c
index 6839207..7dbe496 100644
--- a/src/backend/parser/parse_relation.c
+++ b/src/backend/parser/parse_relation.c
@@ -2745,10 +2745,10 @@ ExecCheckRTPermsWithRanger(List *rangeTable)
     RangeTblEntry *rte = (RangeTblEntry *) lfirst(l);
 
     if (rte->rtekind != RTE_RELATION)
-      return;
+      continue;
     requiredPerms = rte->requiredPerms;
     if (requiredPerms == 0)
-      return;
+      continue;
     
     relOid = rte->relid;
     userid = rte->checkAsUser ? rte->checkAsUser : GetUserId();
@@ -2763,6 +2763,9 @@ ExecCheckRTPermsWithRanger(List *rangeTable)
 
   } // foreach
 
+  if (ranger_check_args == NIL)
+    return;
+
   // ranger ACL check with package Oids
   List *aclresults = NIL;
   aclresults = pg_rangercheck_batch(ranger_check_args);


Mime
View raw message