You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Daniel Templeton (JIRA)" <ji...@apache.org> on 2016/02/05 15:40:39 UTC

[jira] [Created] (HDFS-9769) Multiple tests use incorrect file permissions

Daniel Templeton created HDFS-9769:
--------------------------------------

             Summary: Multiple tests use incorrect file permissions
                 Key: HDFS-9769
                 URL: https://issues.apache.org/jira/browse/HDFS-9769
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: test
    Affects Versions: 2.8.0
            Reporter: Daniel Templeton
            Assignee: Daniel Templeton


The {{FsPermission.<init>(short)}} constructor takes the mode as an octal short.  Setting a permission of a+rwx should therefore look like {{FsPermission((short)0777)}}.  In several cases, the permissions are set like {{FsPermission((short)777)}} instead, which actually would set the permissions to u+r,g+x,o+x and turn on the sticky bit (777 = 01411).  The error clearly doesn't cause the tests to fail, but it should be corrected nonetheless.

The tests with bad permissions are:
# {{TestSecureNameNode.testName()}}
# {{TestMover.testMoverWithStripedFile()}}
# {{TestBalancer.testTwoReplicaShouldNotInSameDN()}}
# {{TestAuditLogger.testAuditLoggerWithCallContext()}}
# {{TestFSImage.testSaveAndLoadStripedINodeFile()}}

The last one is particularly entertaining because it tries to set the permissions in hex.

This JIRA should also include making the {{FsPermission}} docs clearer so that it's harder to make this mistake.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)