Skip to content

fs: fix realpath of namespaced drive paths - #65378

Open
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:fix-62446-1
Open

fs: fix realpath of namespaced drive paths#65378
jazelly wants to merge 1 commit into
nodejs:mainfrom
jazelly:fix-62446-1

Conversation

@jazelly

@jazelly jazelly commented Aug 18, 2026

Copy link
Copy Markdown
Member

The JavaScript realpath implementation probes a namespaced drive root through the fs binding. Windows path resolution drops the trailing separator from that probe, so lstat receives C: and reports EISDIR.

Use the regular drive-root spelling only for the probe. Preserve the namespaced spelling for traversal and returned paths.

Fixes: #62446


AI Disclaimer: I used AI to help me evaluate approaches. My initial attempt at #62639 was too breaking.

@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 Aug 18, 2026
@jazelly
jazelly marked this pull request as ready for review August 18, 2026 12:25
@jazelly jazelly added the windows Issues and PRs related to the Windows platform. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (cf30b2e) to head (230ce75).
⚠️ Report is 17 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #65378    +/-   ##
========================================
  Coverage   90.11%   90.12%            
========================================
  Files         752      752            
  Lines      251861   252212   +351     
  Branches    47365    47446    +81     
========================================
+ Hits       226955   227296   +341     
+ Misses      16238    16213    -25     
- Partials     8668     8703    +35     
Files with missing lines Coverage Δ
lib/fs.js 98.42% <100.00%> (+0.05%) ⬆️

... and 51 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.

The JavaScript realpath implementation probes a namespaced drive root
through the fs binding. Windows path resolution drops the trailing
separator from that probe, so lstat receives C: and reports EISDIR.

Use the regular drive-root spelling only for the probe. Preserve the
namespaced spelling for traversal and returned paths.

Signed-off-by: Jason Zhang <xzha4350@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Node cannot handle extended windows paths

2 participants