Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-13612

FileSystem static mkdirs(FS, path, permissions) to invoke FS.mkdirs(path, permissions)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 2.7.3
    • None
    • fs
    • None

    Description

      Currently FileSystem's static mkdirs(FileSystem fs, Path dir, FsPermission permission) creates the directory in a two step operation

          // create the directory using the default permission
          boolean result = fs.mkdirs(dir);
          // set its permission to be the supplied one
          fs.setPermission(dir, permission);
      

      this isn't atomic and creates a risk of race/security conditions. This code is used in production

      Better to simply forward to mkdirs(path, permissions).

      is there any reason to not do that?

      Attachments

        1. HADOOP-13612-branch-2-001.patch
          0.9 kB
          Steve Loughran

        Issue Links

          Activity

            People

              stevel@apache.org Steve Loughran
              stevel@apache.org Steve Loughran
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: