hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject hadoop git commit: HADOOP-12878. KMS SPNEGO sequence does not work with WEBHDFS. Contributed by Xiaoyu Yao.
Date Wed, 17 Feb 2016 16:52:00 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 7ccb0e060 -> 595342154


HADOOP-12878. KMS SPNEGO sequence does not work with WEBHDFS. Contributed by Xiaoyu Yao.

(cherry picked from commit fd1befb6ba450e45b1fcb3fb28b0da6c48daf6b3)


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

Branch: refs/heads/branch-2.8
Commit: 595342154470a4bc98b87c76d1f60ba352338ff5
Parents: 7ccb0e0
Author: Xiaoyu Yao <xyao@apache.org>
Authored: Wed Feb 17 08:27:27 2016 -0800
Committer: Xiaoyu Yao <xyao@apache.org>
Committed: Wed Feb 17 08:47:30 2016 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt       |  2 ++
 .../hadoop/crypto/key/kms/KMSClientProvider.java      | 14 +++++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/59534215/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 5f49c95..14bf8b4 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -1006,6 +1006,8 @@ Release 2.8.0 - UNRELEASED
     HADOOP-12780. During atomic rename handle crash when one directory has been
     renamed but not file under it. (Madhumita Chakraborty via cnauroth)
 
+    HADOOP-12878. KMS SPNEGO sequence does not work with WEBHDFS. (xyao)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/59534215/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
index 9c38181..a73eda6 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java
@@ -397,11 +397,15 @@ public class KMSClientProvider extends KeyProvider implements CryptoExtension,
                     KMS_CLIENT_ENC_KEY_CACHE_NUM_REFILL_THREADS_DEFAULT),
             new EncryptedQueueRefiller());
     authToken = new DelegationTokenAuthenticatedURL.Token();
-    actualUgi =
-        (UserGroupInformation.getCurrentUser().getAuthenticationMethod() ==
-        UserGroupInformation.AuthenticationMethod.PROXY) ? UserGroupInformation
-            .getCurrentUser().getRealUser() : UserGroupInformation
-            .getCurrentUser();
+    UserGroupInformation.AuthenticationMethod authMethod =
+        UserGroupInformation.getCurrentUser().getAuthenticationMethod();
+    if (authMethod == UserGroupInformation.AuthenticationMethod.PROXY) {
+      actualUgi = UserGroupInformation.getCurrentUser().getRealUser();
+    } else if (authMethod == UserGroupInformation.AuthenticationMethod.TOKEN) {
+      actualUgi = UserGroupInformation.getLoginUser();
+    } else {
+      actualUgi =UserGroupInformation.getCurrentUser();
+    }
   }
 
   private static Path extractKMSPath(URI uri) throws MalformedURLException, IOException {


Mime
View raw message