Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-27545

Ensure that the baseStagingDir created by SecureBulkLoadManager has the correct permissions

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • None
    • 2.5.2
    • regionserver
    • None

    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.

      Attachments

        Activity

          People

            skysider Zhang Dongsheng
            skysider Zhang Dongsheng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: