Browse Source

Fix a kerberos configuration bug and make the thrift auth bridge create
remote users as though they were authenticated via Kerberos.

Aaron T. Myers 15 years ago
parent
commit
65d2b43c9c

+ 0 - 2
desktop/core/src/desktop/conf.py

@@ -209,8 +209,6 @@ KERBEROS = ConfigSection(
   )
   )
 )
 )
 
 
-      
-
 # See python's documentation for time.tzset for valid values.
 # See python's documentation for time.tzset for valid values.
 TIME_ZONE = Config(
 TIME_ZONE = Config(
   key="time_zone",
   key="time_zone",

+ 2 - 0
desktop/libs/hadoop/java/src/java/org/apache/hadoop/thriftfs/HadoopThriftAuthBridge.java

@@ -30,6 +30,7 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.security.SaslRpcServer.AuthMethod;
 import org.apache.hadoop.security.SaslRpcServer.AuthMethod;
 import org.apache.hadoop.security.*;
 import org.apache.hadoop.security.*;
+import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
 import org.apache.thrift.TException;
 import org.apache.thrift.TException;
 import org.apache.thrift.transport.TSaslClientTransport;
 import org.apache.thrift.transport.TSaslClientTransport;
 import org.apache.thrift.transport.TSaslServerTransport;
 import org.apache.thrift.transport.TSaslServerTransport;
@@ -185,6 +186,7 @@ class HadoopThriftAuthBridge {
         LOG.debug("Authenticated  " + authId + " for Thrift call ");
         LOG.debug("Authenticated  " + authId + " for Thrift call ");
 
 
         UserGroupInformation clientUgi = UserGroupInformation.createRemoteUser(authId);
         UserGroupInformation clientUgi = UserGroupInformation.createRemoteUser(authId);
+        clientUgi.setAuthenticationMethod(AuthenticationMethod.KERBEROS);
 
 
         try {
         try {
           return clientUgi.doAs(new PrivilegedExceptionAction<Boolean>() {
           return clientUgi.doAs(new PrivilegedExceptionAction<Boolean>() {

+ 1 - 1
desktop/libs/hadoop/src/hadoop/conf.py

@@ -117,7 +117,7 @@ HDFS_CLUSTERS = UnspecifiedConfigSection(
                             type=int),
                             type=int),
       NN_KERBEROS_PRINCIPAL=Config("nn_kerberos_principal", help="Kerberos principal for NameNode",
       NN_KERBEROS_PRINCIPAL=Config("nn_kerberos_principal", help="Kerberos principal for NameNode",
                                    default="hdfs", type=str),
                                    default="hdfs", type=str),
-      DN_KERBEROS_PRINCIPAL=Config("nn_kerberos_principal", help="Kerberos principal for DataNode",
+      DN_KERBEROS_PRINCIPAL=Config("dn_kerberos_principal", help="Kerberos principal for DataNode",
                                    default="hdfs", type=str),
                                    default="hdfs", type=str),
       SECURITY_ENABLED=Config("security_enabled", help="Is running with Kerberos authentication",
       SECURITY_ENABLED=Config("security_enabled", help="Is running with Kerberos authentication",
                               default=False, type=coerce_bool),
                               default=False, type=coerce_bool),