Repository: hive Updated Branches: refs/heads/master a9581995d -> 494b771ac
HIVE-20508 : Hive does not support user names of type "user@realm" (Deepak Jaiswal, reviewed by Thejas Nair) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/494b771a Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/494b771a Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/494b771a Branch: refs/heads/master Commit: 494b771ac02455d1a162570fa5fd26be55e0152c Parents: a958199 Author: Deepak Jaiswal <[email protected]> Authored: Wed Sep 5 23:32:23 2018 -0700 Committer: Deepak Jaiswal <[email protected]> Committed: Sun Sep 9 17:03:22 2018 -0700 ---------------------------------------------------------------------- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java | 2 ++ .../org/apache/hive/service/cli/thrift/ThriftCLIService.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/494b771a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java ---------------------------------------------------------------------- diff --git a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java index 40ea3ac..aa58d74 100644 --- a/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java +++ b/common/src/java/org/apache/hadoop/hive/conf/HiveConf.java @@ -2793,6 +2793,8 @@ public class HiveConf extends Configuration { "hive.test.authz.sstd.hs2.mode", false, "test hs2 mode from .q tests", true), HIVE_AUTHORIZATION_ENABLED("hive.security.authorization.enabled", false, "enable or disable the Hive client authorization"), + HIVE_AUTHORIZATION_KERBEROS_USE_SHORTNAME("hive.security.authorization.kerberos.use.shortname", true, + "use short name in Kerberos cluster"), HIVE_AUTHORIZATION_MANAGER("hive.security.authorization.manager", "org.apache.hadoop.hive.ql.security.authorization.plugin.sqlstd.SQLStdHiveAuthorizerFactory", "The Hive client authorization manager class name. The user defined authorization class should implement \n" + http://git-wip-us.apache.org/repos/asf/hive/blob/494b771a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java ---------------------------------------------------------------------- diff --git a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java index 259ca63..059e4c9 100644 --- a/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ b/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -428,7 +428,11 @@ public abstract class ThriftCLIService extends AbstractService implements TCLISe userName = req.getUsername(); } - userName = getShortName(userName); + if (cliService.getHiveConf().getBoolVar(ConfVars.HIVE_AUTHORIZATION_KERBEROS_USE_SHORTNAME)) + { + userName = getShortName(userName); + } + String effectiveClientUser = getProxyUser(userName, req.getConfiguration(), getIpAddress()); LOG.debug("Client's username: " + effectiveClientUser); return effectiveClientUser;
