hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomwh...@apache.org
Subject svn commit: r1091588 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/fs/FileSystem.java src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
Date Tue, 12 Apr 2011 22:34:12 GMT
Author: tomwhite
Date: Tue Apr 12 22:34:11 2011
New Revision: 1091588

URL: http://svn.apache.org/viewvc?rev=1091588&view=rev
Log:
HADOOP-6898. FileSystem.copyToLocal creates files with 777 permissions. Contributed by Aaron
T. Myers.

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileSystem.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=1091588&r1=1091587&r2=1091588&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Tue Apr 12 22:34:11 2011
@@ -568,6 +568,9 @@ Release 0.22.0 - Unreleased
 
     HADOOP-7156. Workaround for unsafe implementations of getpwuid_r (todd)
 
+    HADOOP-6898. FileSystem.copyToLocal creates files with 777 permissions.
+    (Aaron T. Myers via tomwhite)
+
 Release 0.21.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileSystem.java?rev=1091588&r1=1091587&r2=1091588&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileSystem.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/fs/FileSystem.java Tue Apr 12 22:34:11
2011
@@ -659,7 +659,8 @@ public abstract class FileSystem extends
                                             long blockSize,
                                             Progressable progress
                                             ) throws IOException {
-    return this.create(f, FsPermission.getDefault(), overwrite, bufferSize,
+    return this.create(f, FsPermission.getDefault().applyUMask(
+        FsPermission.getUMask(getConf())), overwrite, bufferSize,
         replication, blockSize, progress);
   }
 

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java?rev=1091588&r1=1091587&r2=1091588&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
(original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
Tue Apr 12 22:34:11 2011
@@ -71,7 +71,9 @@ public class TestLocalFileSystemPermissi
     String filename = "foo";
     Path f = writeFile(localfs, filename);
     try {
-      System.out.println(filename + ": " + getPermission(localfs, f));
+      FsPermission initialPermission = getPermission(localfs, f);
+      System.out.println(filename + ": " + initialPermission);
+      assertEquals(FsPermission.getDefault().applyUMask(FsPermission.getUMask(conf)), initialPermission);
     }
     catch(Exception e) {
       System.out.println(StringUtils.stringifyException(e));



Mime
View raw message