You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by dk...@apache.org on 2023/01/19 19:05:58 UTC
[hive] branch master updated: HIVE-26739: Fix the hiveserver2 error(No valid credentials provided) connecting metastore when HADOOP_USER_NAME environment variable exists and kerberos is enabled (xiuzhu9527, reviewed by Denys Kuzmenko)
This is an automated email from the ASF dual-hosted git repository.
dkuzmenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 60d81776a6d HIVE-26739: Fix the hiveserver2 error(No valid credentials provided) connecting metastore when HADOOP_USER_NAME environment variable exists and kerberos is enabled (xiuzhu9527, reviewed by Denys Kuzmenko)
60d81776a6d is described below
commit 60d81776a6d99a20a8d1fd13384754e09694c0e6
Author: xiuzhu9527 <14...@QQ.COM>
AuthorDate: Fri Jan 20 03:05:52 2023 +0800
HIVE-26739: Fix the hiveserver2 error(No valid credentials provided) connecting metastore when HADOOP_USER_NAME environment variable exists and kerberos is enabled (xiuzhu9527, reviewed by Denys Kuzmenko)
Closed #3764
---
shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java b/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
index 7cf78dca91f..339f0b5e9c9 100644
--- a/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
+++ b/shims/common/src/main/java/org/apache/hadoop/hive/shims/Utils.java
@@ -56,6 +56,10 @@ public class Utils {
public static final String DISTCP_OPTIONS_PREFIX = "distcp.options.";
public static UserGroupInformation getUGI() throws LoginException, IOException {
+ if (UserGroupInformation.isSecurityEnabled()) {
+ return UserGroupInformation.getCurrentUser();
+ }
+
String doAs = System.getenv("HADOOP_USER_NAME");
if(doAs != null && doAs.length() > 0) {
/*