hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From da...@apache.org
Subject hive git commit: HIVE-20389: NPE in SessionStateUserAuthenticator when authenticator=SessionStateUserAuthenticator (Daniel Dai, reviewed by Thejas Nair)
Date Wed, 15 Aug 2018 17:22:07 GMT
Repository: hive
Updated Branches:
  refs/heads/master 691e65448 -> ac247c430


HIVE-20389: NPE in SessionStateUserAuthenticator when authenticator=SessionStateUserAuthenticator
(Daniel Dai, 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/ac247c43
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/ac247c43
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/ac247c43

Branch: refs/heads/master
Commit: ac247c4304f45ce7766deacb4826907000447c43
Parents: 691e654
Author: Daniel Dai <daijyc@gmail.com>
Authored: Wed Aug 15 10:21:46 2018 -0700
Committer: Daniel Dai <daijyc@gmail.com>
Committed: Wed Aug 15 10:21:46 2018 -0700

----------------------------------------------------------------------
 .../hadoop/hive/ql/security/SessionStateUserAuthenticator.java | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/ac247c43/ql/src/java/org/apache/hadoop/hive/ql/security/SessionStateUserAuthenticator.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/security/SessionStateUserAuthenticator.java
b/ql/src/java/org/apache/hadoop/hive/ql/security/SessionStateUserAuthenticator.java
index 1ded295..226fbe0 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/security/SessionStateUserAuthenticator.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/security/SessionStateUserAuthenticator.java
@@ -18,7 +18,6 @@
 
 package org.apache.hadoop.hive.ql.security;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
@@ -32,15 +31,14 @@ import org.apache.hadoop.security.UserGroupInformation;
  */
 public class SessionStateUserAuthenticator implements HiveAuthenticationProvider {
 
-  private final List<String> groupNames = new ArrayList<String>();
-
   protected Configuration conf;
   private SessionState sessionState;
   private List<String> groups;
 
   @Override
   public List<String> getGroupNames() {
-    if (groups == null) {
+       // In case of embedded hs2, sessionState.getUserName()=null
+    if (groups == null && sessionState.getUserName() != null) {
       groups = UserGroupInformation.createRemoteUser(sessionState.getUserName()).getGroups();
     }
     return groups;


Mime
View raw message