hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077075 - in /hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop: hdfs/TestDFSPermission.java security/TestPermission.java
Date Fri, 04 Mar 2011 03:37:53 GMT
Author: omalley
Date: Fri Mar  4 03:37:52 2011
New Revision: 1077075

URL: http://svn.apache.org/viewvc?rev=1077075&view=rev
Log:
commit 173f438ab9eef9df7d5f95d32cc1b723ea870628
Author: Jakob Homan <jhoman@yahoo-inc.com>
Date:   Mon Dec 14 19:45:50 2009 -0800

    HDFS:595 from
    https://issues.apache.org/jira/secure/attachment/12427977/HDFS-595-Y20.patch
    
    +++ b/YAHOO-CHANGES.txt
    +    HDFS-595.  umask settings in configuration may now use octal or
    +    symbolic instead of decimal.  Update HDFS tests as such.  (jghoman)

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestDFSPermission.java
    hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/security/TestPermission.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestDFSPermission.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestDFSPermission.java?rev=1077075&r1=1077074&r2=1077075&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestDFSPermission.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/hdfs/TestDFSPermission.java
Fri Mar  4 03:37:52 2011
@@ -153,8 +153,8 @@ public class TestDFSPermission extends T
   /* create a file/directory with the given umask and permission */
   private void create(OpType op, Path name, short umask, 
       FsPermission permission) throws IOException {
-    // set umask in configuration
-    conf.setInt(FsPermission.UMASK_LABEL, umask);
+    // set umask in configuration, converting to padded octal
+    conf.set(FsPermission.UMASK_LABEL, String.format("%1$03o", umask));
 
     // create the file/directory
     switch (op) {

Modified: hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/security/TestPermission.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/security/TestPermission.java?rev=1077075&r1=1077074&r2=1077075&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/security/TestPermission.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/test/org/apache/hadoop/security/TestPermission.java
Fri Mar  4 03:37:52 2011
@@ -66,7 +66,7 @@ public class TestPermission extends Test
   public void testCreate() throws Exception {
     Configuration conf = new Configuration();
     conf.setBoolean("dfs.permissions", true);
-    conf.setInt(FsPermission.UMASK_LABEL, 0);
+    conf.set(FsPermission.UMASK_LABEL, "000");
     MiniDFSCluster cluster = null;
     FileSystem fs = null;
 
@@ -94,7 +94,7 @@ public class TestPermission extends Test
       checkPermission(fs, "/b1/b2", inheritPerm);
       checkPermission(fs, "/b1/b2/b3.txt", filePerm);
       
-      conf.setInt(FsPermission.UMASK_LABEL, 0022);
+      conf.set(FsPermission.UMASK_LABEL, "022");
       FsPermission permission = 
         FsPermission.createImmutable((short)0666);
       FileSystem.mkdirs(fs, new Path("/c1"), new FsPermission(permission));



Mime
View raw message