You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2022/05/06 00:47:28 UTC

[GitHub] [hbase] skysiders commented on a diff in pull request #4391: HBASE-26994 MasterFileSystem create directory without permission check

skysiders commented on code in PR #4391:
URL: https://github.com/apache/hbase/pull/4391#discussion_r866416804


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java:
##########
@@ -355,9 +354,9 @@ private void checkStagingDir() throws IOException {
         if (!this.fs.mkdirs(p, HiddenDirPerms)) {
           throw new IOException("Failed to create staging directory " + p.toString());
         }
-      } else {
-        this.fs.setPermission(p, HiddenDirPerms);
       }
+      this.fs.setPermission(p, HiddenDirPerms);

Review Comment:
   It seems that staging does use HiddenDirPerms for creation, however this permission will be affected by umask in DFSClient. If fs is DistributedFileSystem, if we set too strict umask, such as 777, the final created folder will not have any permissions. I think there might be some API misuse here, in mkdirs(FileSystem fs, Path dir, FsPermission permission) and mkdirs(Path f, FsPermission permission).[mkdirs(FileSystem fs, Path dir, FsPermission permission)](https://github.com/apache/hadoop/blob/d346be9bd2d45d0b17ecf0c2b9d8466f00b47e0d/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L746) and [mkdirs(Path f, FsPermission permission)](https://github.com/apache/hadoop/blob/d346be9bd2d45d0b17ecf0c2b9d8466f00b47e0d/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java#L1471)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@hbase.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org