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

(cherry picked from commit fd1befb6ba)
This commit is contained in:
Xiaoyu Yao 2016-02-17 08:27:27 -08:00
parent 7ccb0e0601
commit 5953421544
2 changed files with 11 additions and 5 deletions

View File

@ -1006,6 +1006,8 @@ Release 2.8.0 - UNRELEASED
HADOOP-12780. During atomic rename handle crash when one directory has been HADOOP-12780. During atomic rename handle crash when one directory has been
renamed but not file under it. (Madhumita Chakraborty via cnauroth) 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 Release 2.7.3 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -397,11 +397,15 @@ public class KMSClientProvider extends KeyProvider implements CryptoExtension,
KMS_CLIENT_ENC_KEY_CACHE_NUM_REFILL_THREADS_DEFAULT), KMS_CLIENT_ENC_KEY_CACHE_NUM_REFILL_THREADS_DEFAULT),
new EncryptedQueueRefiller()); new EncryptedQueueRefiller());
authToken = new DelegationTokenAuthenticatedURL.Token(); authToken = new DelegationTokenAuthenticatedURL.Token();
actualUgi = UserGroupInformation.AuthenticationMethod authMethod =
(UserGroupInformation.getCurrentUser().getAuthenticationMethod() == UserGroupInformation.getCurrentUser().getAuthenticationMethod();
UserGroupInformation.AuthenticationMethod.PROXY) ? UserGroupInformation if (authMethod == UserGroupInformation.AuthenticationMethod.PROXY) {
.getCurrentUser().getRealUser() : UserGroupInformation actualUgi = UserGroupInformation.getCurrentUser().getRealUser();
.getCurrentUser(); } else if (authMethod == UserGroupInformation.AuthenticationMethod.TOKEN) {
actualUgi = UserGroupInformation.getLoginUser();
} else {
actualUgi =UserGroupInformation.getCurrentUser();
}
} }
private static Path extractKMSPath(URI uri) throws MalformedURLException, IOException { private static Path extractKMSPath(URI uri) throws MalformedURLException, IOException {