Skip to content

Conversation

@Xstoudi
Copy link
Contributor

@Xstoudi Xstoudi commented Dec 28, 2025

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: #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.

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
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Dec 28, 2025
@codecov
Copy link

codecov bot commented Dec 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.53%. Comparing base (15bdf38) to head (e2b2166).
⚠️ Report is 11 commits behind head on main.

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     
Files with missing lines Coverage Δ
lib/fs.js 98.19% <100.00%> (+<0.01%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@aduh95 aduh95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All tests are passing, so that seems safe

/cc @nodejs/fs

@aduh95 aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 30, 2025
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 30, 2025
@nodejs-github-bot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.realpathSync does not behave expected

4 participants