[
https://issues.apache.org/jira/browse/HADOOP-9652?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Wang updated HADOOP-9652:
--------------------------------
Attachment: hadoop-9452-1.patch
Patch attached.
I took the approach of shelling out to stat(1) for local filesystems when doing
getFileStatus and getFileLinkStatus. Besides fixing the link owner and mode
issues, this has the added bonus of showing the correct local mod/access times.
Overall, I think this will be more robust than the previous approach.
I also took the opportunity to clean up a bunch of code in DelegateToFileSystem
and RawLocalFs. With symlink support in FileSystem, we can simply delegate in
almost all cases.
This was tested on Linux, and I plugged some strings from the FreeBSD stat(1)
into the new test case (though didn't actually run the tests on FreeBSD).
> RawLocalFs#getFileLinkStatus does not fill in the link owner and mode
> ---------------------------------------------------------------------
>
> Key: HADOOP-9652
> URL: https://issues.apache.org/jira/browse/HADOOP-9652
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Colin Patrick McCabe
> Assignee: Andrew Wang
> Attachments: hadoop-9452-1.patch
>
>
> {{RawLocalFs#getFileLinkStatus}} does not actually get the owner and mode of
> the symlink, but instead uses the owner and mode of the symlink target. If
> the target can't be found, it fills in bogus values (the empty string and
> FsPermission.getDefault) for these.
> Symlinks have an owner distinct from the owner of the target they point to,
> and getFileLinkStatus ought to expose this.
> In some operating systems, symlinks can have a permission other than 0777.
> We ought to expose this in RawLocalFilesystem and other places, although we
> don't necessarily have to support this behavior in HDFS.
--
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