Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: fix file descriptor validator #49752

Merged
merged 1 commit into from Sep 24, 2023

Conversation

anonrig
Copy link
Member

@anonrig anonrig commented Sep 21, 2023

@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 Sep 21, 2023
Copy link
Member

@bnoordhuis bnoordhuis left a 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.)

@anonrig
Copy link
Member Author

anonrig commented Sep 22, 2023

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

@anonrig
Copy link
Member Author

anonrig commented Sep 22, 2023

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

@anonrig anonrig 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 Sep 22, 2023
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 22, 2023
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@anonrig anonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 24, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 24, 2023
@nodejs-github-bot nodejs-github-bot merged commit 5d6aa85 into nodejs:main Sep 24, 2023
58 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in 5d6aa85

ruyadorno pushed a commit that referenced this pull request Sep 28, 2023
PR-URL: #49752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This was referenced Sep 28, 2023
alexfernandez pushed a commit to alexfernandez/node that referenced this pull request Nov 1, 2023
PR-URL: nodejs#49752
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
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.

None yet

4 participants