RFR: 8306882: (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link
Alan Bateman
alanb at openjdk.org
Mon Aug 28 06:45:09 UTC 2023
On Wed, 23 Aug 2023 01:09:16 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:
> Modify `Path.toRealPath` such that it does not collapse links such as "link/.." or "link/../.." when `LinkOption.NOFOLLOW_LINKS` is specified or, in some cases, not.
The changes to the Windows implementation of toRealPath(LinkOption.NOFOLLOW_LINKS) are going to take time to review.
Once suggestion that would help set the groundwork is to move the toRealPath tests to their own JUnit test. It's just historically that they were initially put in Misc.java. Also I think it would be useful to do the change to the Unix implementation separately, I think that needs a summary in the first place to understand why that change is needed.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15397#issuecomment-1695120122
More information about the nio-dev
mailing list