fs: defer path resolution in realpath functions#61194
Closed
Xstoudi wants to merge 1 commit intonodejs:mainfrom
Closed
fs: defer path resolution in realpath functions#61194Xstoudi wants to merge 1 commit intonodejs:mainfrom
Xstoudi wants to merge 1 commit intonodejs:mainfrom
Conversation
In `fs.realpath` and `fs.realpathSync`, path resolution is now performed after symlink traversal instead of before, ensuring correct behavior when dealing with parent directory references (`..`) in paths containing symlinks. Fixes: nodejs#60779
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61194 +/- ##
=======================================
Coverage 88.53% 88.53%
=======================================
Files 703 703
Lines 208598 208601 +3
Branches 40227 40226 -1
=======================================
+ Hits 184674 184683 +9
+ Misses 15951 15939 -12
- Partials 7973 7979 +6
🚀 New features to boost your workflow:
|
aduh95
approved these changes
Dec 30, 2025
Contributor
aduh95
left a comment
There was a problem hiding this comment.
All tests are passing, so that seems safe
/cc @nodejs/fs
Collaborator
lpinca
approved these changes
Dec 30, 2025
jazelly
approved these changes
Dec 31, 2025
Contributor
|
Tests are consistently failing on Windows: |
Contributor
Author
|
Thanks for the warning, I'll setup a windows dual boot and try to fix it. |
Contributor
Author
|
Half the failing test are because my approach was too naive and won't work on Windows. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
fs.realpathandfs.realpathSync, path resolution is now performed after symlink traversal instead of before, ensuring correct behavior when dealing with parent directory references (..) in paths containing symlinks.Fixes: #60779
I may be unaware of full implications of this change, feel free to let me know if it's not the right way to fix it.