You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Peng Cheng (JIRA)" <ji...@apache.org> on 2017/11/09 01:26:01 UTC
[jira] [Created] (HIVE-18024) Driver.compile() should fallback to
SessionState.getUserName() when userName=null
Peng Cheng created HIVE-18024:
---------------------------------
Summary: Driver.compile() should fallback to SessionState.getUserName() when userName=null
Key: HIVE-18024
URL: https://issues.apache.org/jira/browse/HIVE-18024
Project: Hive
Issue Type: Bug
Components: Hive, Query Planning
Affects Versions: 2.3.0, 1.2.2
Reporter: Peng Cheng
Priority: Minor
When Driver.compile() is invoked for the execution of a hive command. A HiveSemanticAnalyzerHookContext will be initialized and later used by a HiveSemanticAnalyzerHook for various purposes (e.g. when integrated with Apache Sentry, its HiveSemanticAnalyzerHook can authorize this command)
In current versions, the data in this HiveSemanticAnalyzerHookContext will come from different and inconsistent resources. e.g. ipAddress will be copied from SessionState.getUserIPAddress, but userName will be copied from Driver.userName.
This has effectively caused HiveSemanticAnalyzerHook to be useless for several authentication/authorization patterns. E.g. When hive.security.authentication.manager is set to SessionStateUserAuthenticator, the userName carried by such SessionState will be invisible to the Hook, which may cause it to yield incorrect result(s).
proposed fix: when Driver.userName=null, the userName of HiveSemanticAnalyzerHookContext should be set to SessionState.get().getUserName() as a fallback measure.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)