- 
    Type:
Bug
 - 
    Resolution: Fixed
 - 
    Priority:
  P4                     
     - 
    Affects Version/s: 11, 17, 20, 21
 - 
    Component/s: core-libs
 
- 
        b14
 - 
        generic
 - 
        linux, os_x
 - 
        Verified
 
                    A DESCRIPTION OF THE PROBLEM :
The function Path.toRealPath(LinkOption... options) when called with LinkOption.NOFOLLOW_LINKS contain logic that does not eliminate ".." where the previous element is a link.
That logic fails to work when a link is followed by "../..".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a symbolic link "/path/to/link" that point to "/absolute/path/to/target"
Create a file "/absolute/path/some_file.txt"
Create a Path object "/path/to/link/../../some_file.txt"
Call the function toRealPath(LinkOption.NOFOLLOW_LINKS), the result will be a non-exiting path "/path/to/some_file.txt" instead of "/path/to/link/../../some_file.txt".
FREQUENCY : always
            
The function Path.toRealPath(LinkOption... options) when called with LinkOption.NOFOLLOW_LINKS contain logic that does not eliminate ".." where the previous element is a link.
That logic fails to work when a link is followed by "../..".
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Create a symbolic link "/path/to/link" that point to "/absolute/path/to/target"
Create a file "/absolute/path/some_file.txt"
Create a Path object "/path/to/link/../../some_file.txt"
Call the function toRealPath(LinkOption.NOFOLLOW_LINKS), the result will be a non-exiting path "/path/to/some_file.txt" instead of "/path/to/link/../../some_file.txt".
FREQUENCY : always
- duplicates
 - 
                    
JDK-8314245 (fs) Path::toRealPath gives divergent results for link/../.. on Unix and Windows
-         
     - Closed
 
 -         
 
- relates to
 - 
                    
JDK-8314245 (fs) Path::toRealPath gives divergent results for link/../.. on Unix and Windows
-         
     - Closed
 
 -         
 - 
                    
JDK-8315273 (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link (win)
-         
     - Closed
 
 -         
 - 
                    
JDK-8315274 (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link (win)
-         
     - Closed
 
 -         
 - 
                    
JDK-8315241 (fs) Move toRealPath tests in java/nio/file/Path/Misc.java to separate JUnit 5 test
-         
     - Resolved
 
 -         
 
             (3 links to)