Hadoop Common
  1. Hadoop Common
  2. HADOOP-6710

Symbolic umask for file creation is not consistent with posix

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.21.0, 0.22.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Currently both octal and symbolic umask are used to reset the file creation mode bits. This is not consistent with the behavior defined in posix. Making it consistent would avoid confusion to the HDFS users.

      1. ASF.LICENSE.NOT.GRANTED--hadoop-6710.patch
        22 kB
        Suresh Srinivas
      2. hadoop-6710.rel20.patch
        22 kB
        Suresh Srinivas

        Activity

        Hide
        Jakob Homan added a comment -

        +1 on 20 version.

        Show
        Jakob Homan added a comment - +1 on 20 version.
        Hide
        Suresh Srinivas added a comment -

        20 version of the patch.

        Show
        Suresh Srinivas added a comment - 20 version of the patch.
        Hide
        Suresh Srinivas added a comment -

        Committed the patch.

        Show
        Suresh Srinivas added a comment - Committed the patch.
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12441987/hadoop-6710.patch
        against trunk revision 937183.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12441987/hadoop-6710.patch against trunk revision 937183. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-h4.grid.sp2.yahoo.net/475/console This message is automatically generated.
        Hide
        Jakob Homan added a comment -

        +1. Looks excellent.

        Show
        Jakob Homan added a comment - +1. Looks excellent.
        Hide
        Suresh Srinivas added a comment -

        Attached patch:

        1. Adds support for posix compliant symbolic umask support with extensive tests
        2. Current symbolic umask of format "u=,g=,o=" is not parsed correctly. This should be same as octal umask 777. Changing the regex to support this.
        Show
        Suresh Srinivas added a comment - Attached patch: Adds support for posix compliant symbolic umask support with extensive tests Current symbolic umask of format "u=,g=,o=" is not parsed correctly. This should be same as octal umask 777. Changing the regex to support this.
        Hide
        Suresh Srinivas added a comment -

        Snippet from the posix specification http://www.opengroup.org/onlinepubs/000095399/utilities/umask.html:
        For a symbolic_mode value, the new value of the file mode creation mask shall be the logical complement of the file permission bits portion of the file mode specified by the symbolic_mode string.

        In a symbolic_mode value, the permissions op characters '' and '' shall be interpreted relative to the current file mode creation mask; '' shall cause the bits for the indicated permissions to be cleared in the mask; '' shall cause the bits for the indicated permissions to be set in the mask.

        The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified.

        In the octal integer form of mode, the specified bits are set in the file mode creation mask.

        The file mode creation mask shall be set to the resulting numeric value.

        Show
        Suresh Srinivas added a comment - Snippet from the posix specification http://www.opengroup.org/onlinepubs/000095399/utilities/umask.html: For a symbolic_mode value, the new value of the file mode creation mask shall be the logical complement of the file permission bits portion of the file mode specified by the symbolic_mode string. In a symbolic_mode value, the permissions op characters ' ' and ' ' shall be interpreted relative to the current file mode creation mask; ' ' shall cause the bits for the indicated permissions to be cleared in the mask; ' ' shall cause the bits for the indicated permissions to be set in the mask. The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified. In the octal integer form of mode, the specified bits are set in the file mode creation mask. The file mode creation mask shall be set to the resulting numeric value.

          People

          • Assignee:
            Suresh Srinivas
            Reporter:
            Suresh Srinivas
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development