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

FsPermission should have different default value, 777 for directory and 666 for file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.2-alpha
    • 2.0.3-alpha, 0.23.7
    • None
    • None

    Description

      The default permission for FileSystem#create is the same default as for FileSystem#mkdirs, namely 0777. It would make more sense for the default to be 0666 for files and 0777 for directories. The current default leads to a lot of files being created with the executable bit that really should not be. One example is anything created with FsShell's copyToLocal.

      For reference, fopen creates files with a mode of 0666 (minus whatever bits are set in the umask; usually 0022. This seems to be the standard behavior and we should follow it. This is also a regression since branch-1.

      Attachments

        1. HADOOP-9155.patch
          9 kB
          Binglin Chang
        2. HADOOP-9155.v2.patch
          10 kB
          Binglin Chang
        3. HADOOP-9155.v3.patch
          15 kB
          Aaron Myers
        4. HADOOP-9155.v3.patch
          17 kB
          Binglin Chang
        5. HADOOP-9155.v3.patch
          17 kB
          Binglin Chang

        Issue Links

          Activity

            People

              decster Binglin Chang
              decster Binglin Chang
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: