RFR: 8315273: (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link (win) [v5]

Brian Burkhalter bpb at openjdk.org
Wed Sep 11 23:52:14 UTC 2024


On Fri, 1 Mar 2024 21:48:22 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Windows implementation of integrated pull request #15397. The test java/nio/file/Path/ToRealPath.java is also removed from the problem list.
>
> Brian Burkhalter has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits:
> 
>  - 8315273: Re-remove ToRealPath test
>  - Merge
>  - 8315273: Revert ProblemList
>  - Merge
>  - Merge
>  - 8315273: Add bug ID to test
>  - 8315273: (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link (win)

Consider this case:

CWD = C:\Users\bpb\dev\bugs:

1. Create these directories, file, and link in the CWD:

file
dir\subdir
link -> dir\subdir
path = link....\file

2. Invoke path.toRealPath:
2.1 mainline results

follow links     C:\Users\bpb\dev\file
no follow links  C:\Users\bpb\dev\file

2.2 PR results

follow links      C:\Users\bpb\dev\bugs\file
no follow links   C:\Users\bpb\dev\bugs\link....\file

The results of the current mainline are incorrect as they locate a non-existent file. The results of the PR version both correctly locate the file.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15525#issuecomment-2344985712


More information about the nio-dev mailing list