Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
This issues is same as
HBASE-26985
Description
In the start function of SecureBulkLoadManager, there is the following code segment
public void start() throws IOException { ...... fs = FileSystem.get(conf); baseStagingDir = new Path(CommonFSUtils.getRootDir(conf), HConstants.BULKLOAD_STAGING_DIR_NAME); ...... if (!fs.exists(baseStagingDir)) { fs.mkdirs(baseStagingDir, PERM_HIDDEN); } }
It can be seen that the run function will use the mkdirs to create the path when baseStagingDir does not exist, and the parameters passed in include the path variable baseStagingDir and a permission 700. But we haven't confirmed whether the permission is correctly assigned to the file.
The above question is raised because there are two mkdir functions of hadoop, namely
mkdirs(Path f, FsPermission permission)
and
mkdirs(FileSystem fs, Path dir, FsPermission permission)
, and the first one is used here. The permissions of this function will be affected by the underlying umask. Although 700 here will hardly be affected by umask, but I think from a rigorous point of view, we should have one more permission check and permission grant here.