Skip to content

fs: fix file descriptor validator - #49752

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
anonrig:fix-file-descriptors
Sep 24, 2023
Merged

fs: fix file descriptor validator#49752
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
anonrig:fix-file-descriptors

Conversation

@anonrig

Copy link
Copy Markdown
Member

@nodejs-github-botnodejs-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

@bnoordhuisbnoordhuis left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
MemberAuthor

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

@anonrig

Copy link
Copy Markdown
MemberAuthor

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

@anonriganonrig 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-actionsgithub-actionsBot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 22, 2023
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@anonriganonrig added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 24, 2023
@nodejs-github-botnodejs-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:mainSep 24, 2023
@nodejs-github-bot

Copy link
Copy Markdown
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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.fsIssues and PRs related to the fs subsystem / file system.needs-ciPRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@anonrig@nodejs-github-bot@bnoordhuis@lpinca