Skip to content

fs: suggest --allow-fs-read in lstat permission errors - #66969

Open
RafaelGSS wants to merge 2 commits into
nodejs:mainfrom
RafaelGSS:suggest-allow-fs-read-in-lstat-permission-errors
Open

RafaelGSS wants to merge 2 commits into
nodejs:mainfrom
RafaelGSS:suggest-allow-fs-read-in-lstat-permission-errors

Conversation

@RafaelGSS

Copy link
Copy Markdown
Member

fs: suggest --allow-fs-read in lstat permission errors

This was missed in #57585.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/security-wg

@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run. labels Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.58824% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.50%. Comparing base (1106479) to head (8f651d2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/fs/promises.js 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #66969   +/-   ##
=======================================
  Coverage   90.49%   90.50%           
=======================================
  Files         805      805           
  Lines      285780   285792   +12     
  Branches    55176    55181    +5     
=======================================
+ Hits       258628   258650   +22     
+ Misses      17263    17220   -43     
- Partials     9889     9922   +33     
Files with missing lines Coverage Δ
lib/fs.js 97.12% <100.00%> (+<0.01%) ⬆️
lib/internal/fs/promises.js 91.71% <0.00%> (-0.15%) ⬇️

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

@RafaelGSS RafaelGSS added the permission Issues and PRs related to the Permission Model. label Oct 31, 2026
@RafaelGSS

Copy link
Copy Markdown
Member Author

PTAL @nodejs/security-wg

@vedchaudhari

Copy link
Copy Markdown
Contributor

Small thing I noticed while looking at this: I think process.report.writeReport() might have been missed too. It still shows the message without the hint:

  • fs.writeFileSync() → "Access to this API has been restricted. Use --allow-fs-write to manage permissions."
  • process.report.writeReport() → "Access to this API has been restricted"

Happy to open a separate PR for it if that's easier.

@RafaelGSS RafaelGSS added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 20, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 20, 2026
@nodejs-github-bot

This comment was marked as outdated.

@RafaelGSS

Copy link
Copy Markdown
Member Author

Small thing I noticed while looking at this: I think process.report.writeReport() might have been missed too. It still shows the message without the hint:

  • fs.writeFileSync() → "Access to this API has been restricted. Use --allow-fs-write to manage permissions."
  • process.report.writeReport() → "Access to this API has been restricted"

Happy to open a separate PR for it if that's easier.

Yeah, please, open a separate PR.

@nodejs-github-bot

This comment was marked as outdated.

@jasnell jasnell added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 22, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 23, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

This was missed in nodejs#57585.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
test: expect namespaced lstat resource in traversal fixture

Assisted-by: Claude Code
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
@RafaelGSS
RafaelGSS force-pushed the suggest-allow-fs-read-in-lstat-permission-errors branch from 6916c69 to 8f651d2 Compare November 25, 2026 17:26
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 file-system APIs and the fs module. needs-ci PRs that need a full CI run. permission Issues and PRs related to the Permission Model.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants