Przeglądaj źródła

HDFS-1021. specify correct server principal for RefreshAuthorizationPolicyProtocol and RefreshUserToGroupMappingsProtocol protocols in DFSAdmin (for HADOOP-6612)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@944401 13f79535-47bb-0310-9956-ffa450edef68
Boris Shkolnik 15 lat temu
rodzic
commit
933d2a83e1
2 zmienionych plików z 19 dodań i 0 usunięć
  1. 5 0
      CHANGES.txt
  2. 14 0
      src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java

+ 5 - 0
CHANGES.txt

@@ -13,6 +13,11 @@ Trunk (unreleased changes)
     HDFS=1079. Throw exceptions as specified by the AbstractFileSystem
     in HDFS implemenation and protocols. (suresh)
 
+  BUG FIXES
+
+    HDFS 1021. specify correct server principal for RefreshAuthorizationPolicyProtocol 
+    and RefreshUserToGroupMappingsProtocol protocols in DFSAdmin (for HADOOP-6612) (boryas)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 14 - 0
src/java/org/apache/hadoop/hdfs/tools/DFSAdmin.java

@@ -25,6 +25,7 @@ import java.util.List;
 import java.util.TreeSet;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.CommonConfigurationKeys;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.FsShell;
 import org.apache.hadoop.fs.FsStatus;
@@ -32,6 +33,7 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.shell.Command;
 import org.apache.hadoop.fs.shell.CommandFormat;
 import org.apache.hadoop.hdfs.DFSClient;
+import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
 import org.apache.hadoop.hdfs.protocol.FSConstants;
@@ -728,6 +730,12 @@ public class DFSAdmin extends FsShell {
     // Get the current configuration
     Configuration conf = getConf();
     
+    // for security authorization
+    // server principal for this call   
+    // should be NN's one.
+    conf.set(CommonConfigurationKeys.HADOOP_SECURITY_SERVICE_USER_NAME_KEY, 
+        conf.get(DFSConfigKeys.DFS_NAMENODE_USER_NAME_KEY, ""));
+
     // Create the client
     RefreshAuthorizationPolicyProtocol refreshProtocol = 
       (RefreshAuthorizationPolicyProtocol) 
@@ -752,6 +760,12 @@ public class DFSAdmin extends FsShell {
     // Get the current configuration
     Configuration conf = getConf();
     
+    // for security authorization
+    // server principal for this call   
+    // should be NN's one.
+    conf.set(CommonConfigurationKeys.HADOOP_SECURITY_SERVICE_USER_NAME_KEY, 
+        conf.get(DFSConfigKeys.DFS_NAMENODE_USER_NAME_KEY, ""));
+ 
     // Create the client
     RefreshUserToGroupMappingsProtocol refreshProtocol = 
       (RefreshUserToGroupMappingsProtocol)