sentry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kal...@apache.org
Subject [sentry] branch master updated: SENTRY-2497: show grant role results should handle case where URI doesn't have a defined scheme. (Haley Reeve reviewed by Na Li).
Date Mon, 25 Feb 2019 21:19:21 GMT
This is an automated email from the ASF dual-hosted git repository.

kalyan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sentry.git


The following commit(s) were added to refs/heads/master by this push:
     new 2005d56  SENTRY-2497: show grant role results should handle case where URI doesn't
have a defined scheme. (Haley Reeve reviewed by Na Li).
2005d56 is described below

commit 2005d56bb868e2913bacbaa28eaf10454496cc70
Author: Kalyan Kumar Kalvagadda <kkalyan@cloudera.com>
AuthorDate: Mon Feb 25 15:16:28 2019 -0600

    SENTRY-2497: show grant role results should handle case where URI doesn't have a defined
scheme. (Haley Reeve reviewed by Na Li).
    
    Change-Id: I97bb61695ec12092afdb6df0898939ef04c08de5
---
 .../org/apache/sentry/binding/util/SentryAuthorizerUtil.java     | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/util/SentryAuthorizerUtil.java
b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/util/SentryAuthorizerUtil.java
index 5996b6c..eec068b 100644
--- a/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/util/SentryAuthorizerUtil.java
+++ b/sentry-binding/sentry-binding-hive/src/main/java/org/apache/sentry/binding/util/SentryAuthorizerUtil.java
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hive.common.JavaUtils;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
@@ -280,11 +281,9 @@ public class SentryAuthorizerUtil {
 
   public static boolean isLocalUri(String uriString) throws URISyntaxException {
     URI uri = new URI(uriString);
-    if (uri.getScheme().equalsIgnoreCase("file")) {
-      return true;
-    }
-
-    return false;
+    Path uriPath = new Path(uri);
+    return ((uri.getScheme() != null && uri.getScheme().equalsIgnoreCase("file"))
||
+            (uri.getScheme() == null && uriPath.isAbsolute()));
   }
 
   /**


Mime
View raw message