GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fs: fix file descriptor validator by anonrig · Pull Request #49752 · nodejs/node

Conversation

@anonrig

@anonrig anonrig commented Sep 21, 2023

Copy link
Copy Markdown
Member

Ref #49691 (comment) by @bnoordhuis

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with heart emoji
All reactions
  • ❤️ 1 reaction
@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 Sep 21, 2023
bnoordhuis
bnoordhuis approved these changes Sep 22, 2023
View reviewed changes

@bnoordhuis bnoordhuis left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

One additional step you could take is this (pseudo-ish code):

if (isFd(fd)) validateInteger(fd, 'options.fd', 0, kMaxInt32);

While passing ex. -1 or -42 to libuv is Mostly Harmless (should fail with UV_EBADF) it's probably best to turn what is currently a runtime error into a validation error. That might make it semver-major though.

(And I vote to rename kMaxInt to kMaxUint32 because I find the former highly misleading.)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lpinca
lpinca approved these changes Sep 22, 2023
View reviewed changes
@anonrig
fs: fix file descriptor validator
fa56769
@anonrig

anonrig commented Sep 22, 2023

Copy link
Copy Markdown
Member Author

@bnoordhuis I'll follow up with a different pull request

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig
anonrig force-pushed the fix-file-descriptors branch from 394e7e0 to fa56769 Compare September 22, 2023 17:25
@anonrig

anonrig commented Sep 22, 2023

Copy link
Copy Markdown
Member Author

@lpinca @bnoordhuis I had to force-push to rebase. Can you re-review?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig anonrig added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Sep 22, 2023
bnoordhuis
bnoordhuis approved these changes Sep 22, 2023
View reviewed changes
@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 Sep 22, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 22, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54163/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Sep 23, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54181/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Sep 24, 2023
CI Reliability 2023-09-24 nodejs/reliability#675
Open
20 tasks
@nodejs-github-bot

nodejs-github-bot commented Sep 24, 2023

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/54198/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@anonrig anonrig added the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 24, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 24, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 5d6aa85 into nodejs:main Sep 24, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 24, 2023

Copy link
Copy Markdown
Collaborator

Landed in 5d6aa85

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Sep 27, 2023
CI Reliability 2023-09-27 nodejs/reliability#676
Open
21 tasks
ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
@anonrig @ruyadorno
fs: fix file descriptor validator
835f9fe
PR-URL: #49752
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
This was referenced Sep 28, 2023
v20.7.1 proposal #49917
Closed
v20.8.0 proposal #49932
Merged
@robobun robobun mentioned this pull request Nov 2, 2026
node:fs: treat only an int32 as a file descriptor in a path-or-fd argument oven-sh/bun#47728
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
@lpinca lpinca lpinca approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. fs Issues and PRs related to file-system APIs and the fs module. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@anonrig @nodejs-github-bot @bnoordhuis @lpinca
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.