浏览代码

HUE-1188 [beeswax] Support hadoop.rpc.protection set to anything other than "authentication"

Description:

I wrote a quick fix to the issue by hard-coding the QOP used by the Thrift SASL server to "authentication".

Testing Done:

Installed patched jar on a CDH 4.2.0 cluster and beeswax was able to browse tables. It still fails when you run a query due to HIVE-4225.
Joey Echeverria 12 年之前
父节点
当前提交
f13ef3b
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      apps/beeswax/java/src/main/java/com/cloudera/beeswax/Server.java

+ 6 - 1
apps/beeswax/java/src/main/java/com/cloudera/beeswax/Server.java

@@ -54,6 +54,9 @@ import org.apache.thrift.transport.TTransportFactory;
 import com.cloudera.beeswax.api.BeeswaxService;
 import com.cloudera.beeswax.api.BeeswaxService;
 import com.cloudera.beeswax.api.BeeswaxService.Processor;
 import com.cloudera.beeswax.api.BeeswaxService.Processor;
 import com.facebook.fb303.FacebookService;
 import com.facebook.fb303.FacebookService;
+import java.util.HashMap;
+import java.util.Map;
+import javax.security.sasl.Sasl;
 
 
 public class Server {
 public class Server {
 
 
@@ -260,10 +263,12 @@ public class Server {
             "Kerberos principal should have at least 2 parts: " + kerberosName);
             "Kerberos principal should have at least 2 parts: " + kerberosName);
       }
       }
 
 
+      Map<String,String> SASL_PROPS = new HashMap<String, String>(SaslRpcServer.SASL_PROPS);
+      SASL_PROPS.put(Sasl.QOP, SaslRpcServer.QualityOfProtection.AUTHENTICATION.getSaslQop());
       TSaslServerTransport.Factory saslFactory =
       TSaslServerTransport.Factory saslFactory =
           new TSaslServerTransport.Factory(AuthMethod.KERBEROS.getMechanismName(),
           new TSaslServerTransport.Factory(AuthMethod.KERBEROS.getMechanismName(),
               names[0], names[1] , // two parts of kerberos principal
               names[0], names[1] , // two parts of kerberos principal
-              SaslRpcServer.SASL_PROPS,
+              SASL_PROPS,
               new SaslRpcServer.SaslGssCallbackHandler());
               new SaslRpcServer.SaslGssCallbackHandler());
       transFactory = new KbrSaslTransportFactory(saslFactory, bwUgi);
       transFactory = new KbrSaslTransportFactory(saslFactory, bwUgi);
     } else {
     } else {