Browse Source

HDFS-3628. The dfsadmin -setBalancerBandwidth command on branch-1 does not check for superuser privileges. Contributed by Harsh J (harsh)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1360035 13f79535-47bb-0310-9956-ffa450edef68
Harsh J 13 năm trước cách đây
mục cha
commit
ca9b69dc76

+ 3 - 0
CHANGES.txt

@@ -68,6 +68,9 @@ Release 1.2.0 - unreleased
 
     HDFS-2827. Cannot save namespace after renaming a directory above
     a file with an open lease. (Uma Maheswara Rao G via eli)
+
+    HDFS-3628. The dfsadmin -setBalancerBandwidth command on branch-1
+    does not check for superuser privileges. (harsh)
  
 Release 1.1.0 - unreleased
 

+ 1 - 0
src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

@@ -723,6 +723,7 @@ public class FSNamesystem implements FSConstants, FSNamesystemMBean,
    * @throws IOException
    */
   public void setBalancerBandwidth(long bandwidth) throws IOException {
+    checkSuperuserPrivilege();
     synchronized(datanodeMap) {
       for (DatanodeDescriptor nodeInfo : datanodeMap.values()) {
         nodeInfo.setBalancerBandwidth(bandwidth);