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.

This was missed in nodejs#57585.

Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
@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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.54%. Comparing base (03cca65) to head (6916c69).
⚠️ Report is 539 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #66969      +/-   ##
==========================================
- Coverage   90.58%   90.54%   -0.04%     
==========================================
  Files         797      803       +6     
  Lines      278297   285036    +6739     
  Branches    53515    54998    +1483     
==========================================
+ Hits       252096   258096    +6000     
- Misses      16561    17099     +538     
- Partials     9640     9841     +201     
Files with missing lines Coverage Δ
lib/fs.js 97.12% <100.00%> (-0.06%) ⬇️
lib/internal/fs/promises.js 91.71% <100.00%> (+0.49%) ⬆️

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

test: expect namespaced lstat resource in traversal fixture

Assisted-by: Claude Code
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.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 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