Hadoop Common
  1. Hadoop Common
  2. HADOOP-10352

Recursive setfacl erroneously attempts to apply default ACL to files.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 2.4.0
    • Component/s: fs
    • Labels:
      None
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      When calling setfacl -R with an ACL spec containing default ACL entries, the command can fail if there is a mix of directories and files underneath the specified path. It attempts to set the default ACL entries on the files, but only directories can have a default ACL.

        Issue Links

          Activity

          Hide
          Chris Nauroth added a comment -

          The attached patch splits off a separate list of just the access ACL entries. Then, as the command recurses through the tree, files get just the access ACL entries and directories get the full list of access and default ACL entries. This matches the behavior of Linux setfacl.

          I also added tests covering each of the 3 APIs in TestAclCLI.

          Show
          Chris Nauroth added a comment - The attached patch splits off a separate list of just the access ACL entries. Then, as the command recurses through the tree, files get just the access ACL entries and directories get the full list of access and default ACL entries. This matches the behavior of Linux setfacl. I also added tests covering each of the 3 APIs in TestAclCLI .
          Hide
          Arpit Agarwal added a comment -

          +1 for the patch.

          Chris, will the #LF# checks fail on Windows due to the extra CR?

          Show
          Arpit Agarwal added a comment - +1 for the patch. Chris, will the #LF# checks fail on Windows due to the extra CR?
          Hide
          Chris Nauroth added a comment -

          Thanks, Arpit. I'll commit this shortly.

          Chris, will the #LF# checks fail on Windows due to the extra CR?

          No, actually this is a bit of indirection implemented in TestAclCLI so that we have a platform-agnostic token for the line separator inside the XML file. At runtime, this gets replaced with the platform-specific line separator:

              expCmd = expCmd.replaceAll("#LF#",
                  System.getProperty("line.separator"));
          
          Show
          Chris Nauroth added a comment - Thanks, Arpit. I'll commit this shortly. Chris, will the #LF# checks fail on Windows due to the extra CR? No, actually this is a bit of indirection implemented in TestAclCLI so that we have a platform-agnostic token for the line separator inside the XML file. At runtime, this gets replaced with the platform-specific line separator: expCmd = expCmd.replaceAll( "#LF#" , System .getProperty( "line.separator" ));
          Hide
          Arpit Agarwal added a comment -

          Thanks.

          Show
          Arpit Agarwal added a comment - Thanks.
          Hide
          Chris Nauroth added a comment -

          Clarification: I'm going to wait on a Jenkins +1 before committing.

          Show
          Chris Nauroth added a comment - Clarification: I'm going to wait on a Jenkins +1 before committing.
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12630113/HADOOP-10352.1.patch
          against trunk revision .

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

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

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

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 1.3.9) warnings.

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

          -1 core tests. The patch failed these unit tests in hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs:

          org.apache.hadoop.hdfs.server.namenode.ha.TestHASafeMode

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

          Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3591//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3591//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/12630113/HADOOP-10352.1.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 1.3.9) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. -1 core tests . The patch failed these unit tests in hadoop-common-project/hadoop-common hadoop-hdfs-project/hadoop-hdfs: org.apache.hadoop.hdfs.server.namenode.ha.TestHASafeMode +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HADOOP-Build/3591//testReport/ Console output: https://builds.apache.org/job/PreCommit-HADOOP-Build/3591//console This message is automatically generated.
          Hide
          Chris Nauroth added a comment -

          I committed this to trunk. Thank you for the code review, Arpit.

          The failure in TestHASafeMode was unrelated. I couldn't reproduce it locally.

          Show
          Chris Nauroth added a comment - I committed this to trunk. Thank you for the code review, Arpit. The failure in TestHASafeMode was unrelated. I couldn't reproduce it locally.
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Hadoop-trunk-Commit #5202 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5202/)
          HADOOP-10352. Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Show
          Hudson added a comment - SUCCESS: Integrated in Hadoop-trunk-Commit #5202 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5202/ ) HADOOP-10352 . Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #488 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/488/)
          HADOOP-10352. Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #488 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/488/ ) HADOOP-10352 . Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Hdfs-trunk #1680 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1680/)
          HADOOP-10352. Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Show
          Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #1680 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1680/ ) HADOOP-10352 . Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Hide
          Hudson added a comment -

          SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1705 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1705/)
          HADOOP-10352. Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
          • /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml
          Show
          Hudson added a comment - SUCCESS: Integrated in Hadoop-Mapreduce-trunk #1705 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1705/ ) HADOOP-10352 . Recursive setfacl erroneously attempts to apply default ACL to files. Contributed by Chris Nauroth. (cnauroth: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1570466 ) /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt /hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/shell/AclCommands.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testAclCLI.xml

            People

            • Assignee:
              Chris Nauroth
              Reporter:
              Chris Nauroth
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development