hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1076941 - /hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Date Fri, 04 Mar 2011 03:24:24 GMT
Author: omalley
Date: Fri Mar  4 03:24:23 2011
New Revision: 1076941

URL: http://svn.apache.org/viewvc?rev=1076941&view=rev
Log:
commit d9bfc06c66f415ba3e749caba52a2adf6040b2bb
Author: Lee Tucker <ltucker@yahoo-inc.com>
Date:   Thu Jul 30 17:40:26 2009 -0700

    Applying patch 2788241.5818.patch

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=1076941&r1=1076940&r2=1076941&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Fri Mar  4 03:24:23 2011
@@ -501,7 +501,7 @@ public class FSNamesystem implements FSC
    * Dump all metadata into specified file
    */
   synchronized void metaSave(String filename) throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     File file = new File(System.getProperty("hadoop.log.dir"), 
                          filename);
     PrintWriter out = new PrintWriter(new BufferedWriter(
@@ -606,7 +606,7 @@ public class FSNamesystem implements FSC
    */
   synchronized BlocksWithLocations getBlocks(DatanodeID datanode, long size)
       throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
 
     DatanodeDescriptor node = getDatanode(datanode);
     if (node == null) {
@@ -1788,7 +1788,7 @@ public class FSNamesystem implements FSC
    */
   void setQuota(String path, long nsQuota, long dsQuota) throws IOException {
     if (isPermissionEnabled) {
-      checkAccess();
+      checkSuperuserPrivilege();
     }
     
     dir.setQuota(path, nsQuota, dsQuota);
@@ -3410,7 +3410,7 @@ public class FSNamesystem implements FSC
   }
   
   long[] getStats() throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     synchronized(heartbeats) {
       return new long[] {this.capacityTotal, this.capacityUsed, 
                          this.capacityRemaining,
@@ -3550,7 +3550,7 @@ public class FSNamesystem implements FSC
 
   public synchronized DatanodeInfo[] datanodeReport( DatanodeReportType type
       ) throws AccessControlException {
-    checkAccess();
+    checkSuperuserPrivilege();
 
     ArrayList<DatanodeDescriptor> results = getDatanodeListForReport(type);
     DatanodeInfo[] arr = new DatanodeInfo[results.size()];
@@ -3569,7 +3569,7 @@ public class FSNamesystem implements FSC
    * @throws IOException if 
    */
   synchronized void saveNamespace() throws AccessControlException, IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     if(!isInSafeMode()) {
       throw new IOException("Safe mode should be turned ON " +
                             "in order to create namespace image.");
@@ -3825,7 +3825,7 @@ public class FSNamesystem implements FSC
    * 4. Removed from exclude --> stop decommission.
    */
   public void refreshNodes(Configuration conf) throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     // Reread the config to get dfs.hosts and dfs.hosts.exclude filenames.
     // Update the file names and refresh internal includes and excludes list
     if (conf == null)
@@ -3859,7 +3859,7 @@ public class FSNamesystem implements FSC
   }
     
   void finalizeUpgrade() throws IOException {
-    checkAccess();
+    checkSuperuserPrivilege();
     getFSImage().finalizeUpgrade();
   }
 
@@ -4302,7 +4302,7 @@ public class FSNamesystem implements FSC
     
   boolean setSafeMode(SafeModeAction action) throws IOException {
     if (action != SafeModeAction.SAFEMODE_GET) {
-      checkAccess();
+      checkSuperuserPrivilege();
       switch(action) {
       case SAFEMODE_LEAVE: // leave safe mode
         leaveSafeMode(false);
@@ -4484,7 +4484,7 @@ public class FSNamesystem implements FSC
     return checkPermission(path, false, null, null, null, null);
   }
 
-  private void checkAccess() throws AccessControlException {
+  private void checkSuperuserPrivilege() throws AccessControlException {
     if (isPermissionEnabled) {
       PermissionChecker.checkSuperuserPrivilege(fsOwner, supergroup);
     }



Mime
View raw message