hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgumas...@apache.org
Subject svn commit: r1620689 - in /hive/trunk/service/src/java/org/apache/hive/service/cli: CLIService.java thrift/ThriftCLIService.java
Date Tue, 26 Aug 2014 18:43:56 GMT
Author: vgumashta
Date: Tue Aug 26 18:43:56 2014
New Revision: 1620689

URL: http://svn.apache.org/r1620689
Log:
HIVE-7764: Support all JDBC-HiveServer2 authentication modes on a secure cluster (Vaibhav
Gumashta reviewed by Thejas Nair)

Modified:
    hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java
    hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java?rev=1620689&r1=1620688&r2=1620689&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/CLIService.java Tue Aug 26 18:43:56
2014
@@ -46,7 +46,6 @@ import org.apache.hive.service.Composite
 import org.apache.hive.service.ServiceException;
 import org.apache.hive.service.auth.HiveAuthFactory;
 import org.apache.hive.service.cli.operation.Operation;
-import org.apache.hive.service.cli.session.HiveSession;
 import org.apache.hive.service.cli.session.SessionManager;
 import org.apache.hive.service.cli.thrift.TProtocolVersion;
 
@@ -80,11 +79,8 @@ public class CLIService extends Composit
     this.hiveConf = hiveConf;
     sessionManager = new SessionManager();
     addService(sessionManager);
-    /**
-     * If auth mode is Kerberos, do a kerberos login for the service from the keytab
-     */
-    if (hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION).equalsIgnoreCase(
-        HiveAuthFactory.AuthTypes.KERBEROS.toString())) {
+    //  If the hadoop cluster is secure, do a kerberos login for the service from the keytab
+    if (ShimLoader.getHadoopShims().isSecurityEnabled()) {
       try {
         HiveAuthFactory.loginFromKeytab(hiveConf);
         this.serviceUGI = ShimLoader.getHadoopShims().getUGIForConf(hiveConf);

Modified: hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java
URL: http://svn.apache.org/viewvc/hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java?rev=1620689&r1=1620688&r2=1620689&view=diff
==============================================================================
--- hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java (original)
+++ hive/trunk/service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java Tue
Aug 26 18:43:56 2014
@@ -29,7 +29,6 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
-import org.apache.hadoop.hive.ql.session.SessionState;
 import org.apache.hive.service.AbstractService;
 import org.apache.hive.service.auth.HiveAuthFactory;
 import org.apache.hive.service.auth.TSetIpAddressProcessor;
@@ -242,7 +241,9 @@ public abstract class ThriftCLIService e
     if (userName == null) {
       userName = req.getUsername();
     }
-    return getProxyUser(userName, req.getConfiguration(), getIpAddress());
+    String effectiveClientUser = getProxyUser(userName, req.getConfiguration(), getIpAddress());
+    LOG.debug("Client's username: " + effectiveClientUser);
+    return effectiveClientUser;
   }
 
   /**



Mime
View raw message