[
https://issues.apache.org/jira/browse/HADOOP-9367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13594877#comment-13594877
]
Chris Nauroth commented on HADOOP-9367:
---------------------------------------
There are 2 overloads of {{DiskChecker#checkDir}}, and the logic is
inconsistent between them. One uses the canRead/canWrite/canExecute methods of
{{java.io.File}}. The other manually checks for read/write/execute user
permissions via {{FsAction#implies}}. This jira tracks resolution of the
conflicting logic and refactoring to minimized code duplication.
The logic of the latter method, using {{FsAction#implies}}, is incomplete,
because it only checks that the user permissions have read/write/execute
enabled. This works fine if the user that launched the process owns the file,
but it's meaningless if the current user does not own the file. Even if it did
attempt to check if current user == file owner, then the logic would still fail
in combination with more complex permission models that are not covered by
{{FsAction#implies}}. For example, POSIX ACLs on the local file system would
support a named user entry that explicitly grants access to a user different
from the owner. For this reason, I believe we should migrate towards the logic
of the former method, using JDK methods that ultimately delegate down to OS
calls for complete permission checks.
> Consider combining the implementations of DiskChecker.checkDir for all
> supported platforms
> ------------------------------------------------------------------------------------------
>
> Key: HADOOP-9367
> URL: https://issues.apache.org/jira/browse/HADOOP-9367
> Project: Hadoop Common
> Issue Type: Improvement
> Affects Versions: 2.0.3-alpha
> Reporter: Arpit Agarwal
> Fix For: 3.0.0, 2.0.4-beta
>
>
> DiskChecker.checkDir uses different mechanisms to verify disk
> read/write/execute access. Consider combining these up into a single
> implementation.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira