hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject [1/2] hive git commit: HIVE-14316 : TestLlapTokenChecker.testCheckPermissions, testGetToken fail (Sergey Shelukhin, reviewed by Siddharth Seth)
Date Tue, 26 Jul 2016 20:30:14 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.1 186e11b69 -> 6a7bc534a
  refs/heads/master 87bc121a4 -> 9500f23af


HIVE-14316 : TestLlapTokenChecker.testCheckPermissions, testGetToken fail (Sergey Shelukhin,
reviewed by Siddharth Seth)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9500f23a
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9500f23a
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9500f23a

Branch: refs/heads/master
Commit: 9500f23afa435934e9bfba30f9085de5bf34ef0b
Parents: 87bc121
Author: Sergey Shelukhin <sershe@apache.org>
Authored: Tue Jul 26 13:24:37 2016 -0700
Committer: Sergey Shelukhin <sershe@apache.org>
Committed: Tue Jul 26 13:24:37 2016 -0700

----------------------------------------------------------------------
 .../hadoop/hive/llap/daemon/impl/LlapTokenChecker.java      | 9 ++++++---
 .../org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java  | 1 -
 .../hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java  | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/9500f23a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
index 0a688f8..beb5c7f 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/LlapTokenChecker.java
@@ -118,6 +118,9 @@ public final class LlapTokenChecker {
   @VisibleForTesting
   static void checkPermissionsInternal(String kerberosName, List<LlapTokenIdentifier>
tokens,
       String userName, String appId, Object hint) {
+    if (appId == null) {
+      appId = "";
+    }
     if (kerberosName != null && StringUtils.isBlank(appId) && kerberosName.equals(userName))
{
       return;
     }
@@ -127,8 +130,8 @@ public final class LlapTokenChecker {
         if (checkTokenPermissions(userName, appId, tokenUser, tokenAppId)) return;
       }
     }
-    throw new SecurityException("Unauthorized to access "
-        + userName + ", " + appId.hashCode() + " (" + hint + ")");
+    throw new SecurityException(
+        "Unauthorized to access " + userName + ", " + appId + " (" + hint + ")");
   }
 
   public static void checkPermissions(
@@ -139,7 +142,7 @@ public final class LlapTokenChecker {
     }
     if (!checkTokenPermissions(userName, appId, prm.userName, prm.appId)) {
       throw new SecurityException("Unauthorized to access "
-          + userName + ", " + appId.hashCode() + " (" + hint + ")");
+          + userName + ", " + appId + " (" + hint + ")");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hive/blob/9500f23a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
----------------------------------------------------------------------
diff --git a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
index 8e5735f..5c7d4ef 100644
--- a/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
+++ b/llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryInfo.java
@@ -33,7 +33,6 @@ import com.google.common.collect.Lists;
 import com.google.common.collect.Multimap;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hive.llap.LlapUtil;
 import org.apache.hadoop.hive.llap.daemon.FinishableStateUpdateHandler;
 import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SignableVertexSpec;
 import org.apache.hadoop.hive.llap.daemon.rpc.LlapDaemonProtocolProtos.SourceStateProto;

http://git-wip-us.apache.org/repos/asf/hive/blob/9500f23a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
----------------------------------------------------------------------
diff --git a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
index d4ded23..26d0b9b 100644
--- a/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
+++ b/llap-server/src/test/org/apache/hadoop/hive/llap/daemon/impl/TestLlapTokenChecker.java
@@ -65,7 +65,7 @@ public class TestLlapTokenChecker {
   private List<LlapTokenIdentifier> createTokens(String... args) {
     List<LlapTokenIdentifier> tokens = new ArrayList<>();
     for (int i = 0; i < args.length; i += 2) {
-      tokens.add(new LlapTokenIdentifier(null, null, new Text(args[i]), "c", args[i + 1],
false));
+      tokens.add(new LlapTokenIdentifier(new Text(args[i]), null, null, "c", args[i + 1],
false));
     }
     return tokens;
   }


Mime
View raw message