[
https://issues.apache.org/jira/browse/HADOOP-14843?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16157589#comment-16157589
]
Jason Lowe commented on HADOOP-14843:
-------------------------------------
Sorry, I misread the code. I thought it was only testing the bits (i.e.: only
checking the READ bit when asking for "+r"), but I see that it is checking all
the user permission bits when checking if just the READ bit was set.
However I think my point is still valid for these tests wrt. the sticky bit.
For example, if FsPermission had a bug where FsPermission("+r") acted like mode
1444 instead of 0444 then this test in the patch would pass because it's not
checking all of the permission bits:
{code}
FsPermission fs2 = new FsPermission("+r");
assertEquals(READ, fs2.getUserAction());
assertEquals(READ, fs2.getGroupAction());
assertEquals(READ, fs2.getOtherAction());
{code}
That's why I'd rather see the test just check against the integer value of the
permission, so it is testing all of the bits for every test case. It also ends
up being a lot less test code.
> FsPermission symbolic parsing failed to detect invalid argument
> ---------------------------------------------------------------
>
> Key: HADOOP-14843
> URL: https://issues.apache.org/jira/browse/HADOOP-14843
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Affects Versions: 2.7.4, 2.8.1
> Reporter: Jason Lowe
> Assignee: Bharat Viswanadham
> Attachments: HADOOP-14843.01.patch, HADOOP-14843.patch
>
>
> A user misunderstood the syntax format for the FsPermission symbolic
> constructor and passed the argument "-rwr" instead of "u=rw,g=r". In 2.7 and
> earlier this was silently misinterpreted as mode 0777 and in 2.8 it oddly
> became mode 0000. In either case FsPermission should have flagged "-rwr" as
> an invalid argument rather than silently misinterpreting it.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]