[
https://issues.apache.org/jira/browse/HADOOP-8973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13592904#comment-13592904
]
Arpit Agarwal commented on HADOOP-8973:
---------------------------------------
+1 on the approach for its simplicity. It is sound to check for permissions in
this way and we should do the same on other platforms.
A few comments on the code.
Are there any bugs other than the one you link below? I wonder if dir.canRead
can return false when it should return true. We should skip this call on
Windows if it is known to be broken. Same for dir.canWrite and dir.canExecute.
{code}
// This method contains several workarounds to known JVM bugs that cause
// File.canRead, File.canWrite, and File.canExecute to return incorrect
// results on Windows with NTFS ACLs.
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6203387
{code}
Does this change the current directory of the calling process?
{code} String[] cdCmd = new String[] { "cmd", "/C", "cd",
dir.getAbsolutePath() };
{code}
> DiskChecker cannot reliably detect an inaccessible disk on Windows with NTFS
> ACLs
> ---------------------------------------------------------------------------------
>
> Key: HADOOP-8973
> URL: https://issues.apache.org/jira/browse/HADOOP-8973
> Project: Hadoop Common
> Issue Type: Bug
> Components: util
> Affects Versions: trunk-win
> Reporter: Chris Nauroth
> Assignee: Chris Nauroth
> Attachments: HADOOP-8973-branch-trunk-win.patch
>
>
> DiskChecker.checkDir uses File.canRead, File.canWrite, and File.canExecute to
> check if a directory is inaccessible. These APIs are not reliable on Windows
> with NTFS ACLs due to a known JVM bug.
--
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