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 — child_process: fix handling of incorrect uid/gid in spawn by lundibundi · Pull Request #22574 · nodejs/node

Conversation

@lundibundi

@lundibundi lundibundi commented Aug 29, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

uid/gid must be int32, which is asserted on a c++ side but wasn't
checked on a JS side and therefore resulted in a process crash.

Refs: #22570

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines

Also, I'm not sure about the 'correct type' in TypeError, is 'int32' okay?

Sorry, something went wrong.

Uh oh!

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

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@lundibundi
child_process: fix handling of incorrect uid/gid in spawn
c842094
uid/gid must be uint32, which is asserted on a c++ side but wasn't
checked on a JS side and therefore resulted in a process crash.

Refs: nodejs#22570
@lundibundi lundibundi added the child_process Issues and PRs related to the child_process subsystem. label Aug 29, 2018
@nodejs-github-bot

nodejs-github-bot commented Aug 29, 2018

Copy link
Copy Markdown
Collaborator

@lundibundi build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/717/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot nodejs-github-bot added the child_process Issues and PRs related to the child_process subsystem. label Aug 29, 2018
@lundibundi

lundibundi commented Aug 29, 2018

Copy link
Copy Markdown
Member Author

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

All reactions

Sorry, something went wrong.

Uh oh!

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

addaleax
addaleax approved these changes Aug 29, 2018
View reviewed changes
@lundibundi lundibundi added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Aug 29, 2018
cjihrig
cjihrig reviewed Aug 29, 2018
View reviewed changes
Comment thread lib/child_process.js Outdated
if (options.uid != null && !Number.isInteger(options.uid)) {
throw new ERR_INVALID_ARG_TYPE('options.uid', 'integer', options.uid);
if (options.uid != null &&
(!Number.isInteger(options.uid) || !isUint32(options.uid))) {

@cjihrig cjihrig Aug 29, 2018

Copy link
Copy Markdown
Contributor

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.

Is the Number.isInteger() check still needed? Also, don't we want int32 checks to match the C++ checks?

Sorry, something went wrong.

Uh oh!

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

All reactions

@lundibundi lundibundi Aug 29, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

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.

It will look kind of strange (especially if it's an object: {} >>> 1 and {} | 0) but I guess it is redundant.

I actually thought maybe it's worth changing them too, though I don't have enough knowledge of the topic. Linux usage and googling tell me that uid/gid must be non-negative, though maybe some of the systems we support actually support negative uid/gid. Therefore I'd also like some input on this.
In the end, I can always change those to isint32 and a topic of changing them to uint checks may be resolved in a separate PR.

Sorry, something went wrong.

Uh oh!

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

All reactions

@lundibundi lundibundi Aug 29, 2018

Copy link
Copy Markdown
Member Author

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.

After some more googling OpenBSD seem to use -2 as internal "nobody" still.
For now, I'll change it to Int32 and we can discuss this later.

Sorry, something went wrong.

Uh oh!

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

All reactions
@lundibundi
fixup! child_process: fix handling of incorrect uid/gid in spawn
7952acd
@lundibundi

lundibundi commented Aug 29, 2018 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member Author

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

Resume: https://ci.nodejs.org/job/node-test-pull-request/16850/

One more: https://ci.nodejs.org/job/node-test-pull-request/16865/

All reactions

Sorry, something went wrong.

Uh oh!

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

starkwang
starkwang approved these changes Aug 29, 2018
View reviewed changes
lpinca
lpinca approved these changes Aug 29, 2018
View reviewed changes
cjihrig
cjihrig approved these changes Aug 29, 2018
View reviewed changes
BridgeAR
BridgeAR approved these changes Aug 29, 2018
View reviewed changes
trivikr
trivikr approved these changes Aug 29, 2018
View reviewed changes
oliyy
oliyy approved these changes Aug 30, 2018
View reviewed changes
@addaleax addaleax added the lts-watch-v8.x label Aug 31, 2018
@addaleax

addaleax commented Aug 31, 2018

Copy link
Copy Markdown
Member

Landed in 22789fd

All reactions

Sorry, something went wrong.

Uh oh!

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

@addaleax addaleax closed this Aug 31, 2018
addaleax pushed a commit that referenced this pull request Aug 31, 2018
@lundibundi @addaleax
child_process: fix handling of incorrect uid/gid in spawn
22789fd
uid/gid must be uint32, which is asserted on a c++ side but wasn't
checked on a JS side and therefore resulted in a process crash.

Refs: #22570

PR-URL: #22574
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
addaleax pushed a commit that referenced this pull request Aug 31, 2018
@lundibundi @addaleax
child_process: fix handling of incorrect uid/gid in spawn
723ea9a
uid/gid must be uint32, which is asserted on a c++ side but wasn't
checked on a JS side and therefore resulted in a process crash.

Refs: #22570

PR-URL: #22574
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
targos pushed a commit that referenced this pull request Sep 3, 2018
@lundibundi @targos
child_process: fix handling of incorrect uid/gid in spawn
180bb0b
uid/gid must be uint32, which is asserted on a c++ side but wasn't
checked on a JS side and therefore resulted in a process crash.

Refs: #22570

PR-URL: #22574
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
@targos targos mentioned this pull request Sep 5, 2018
Release proposal: v10.10.0 #22716
Merged
targos pushed a commit that referenced this pull request Sep 6, 2018
@lundibundi @targos
child_process: fix handling of incorrect uid/gid in spawn
45eb97e
uid/gid must be uint32, which is asserted on a c++ side but wasn't
checked on a JS side and therefore resulted in a process crash.

Refs: #22570

PR-URL: #22574
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Weijia Wang <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
This was referenced Sep 6, 2018
2018-09-06 Version 10.10.0 (Current) @targos beevelop/docker-android-nodejs#236
Closed
2018-09-06 Version 10.10.0 (Current) @targos beevelop/docker-nodejs#221
Closed
@BethGriggs BethGriggs removed the lts-watch-v8.x label Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@addaleax addaleax addaleax approved these changes
@lpinca lpinca lpinca approved these changes
@cjihrig cjihrig cjihrig approved these changes
@BridgeAR BridgeAR BridgeAR approved these changes
@trivikr trivikr trivikr approved these changes
+2 more reviewers
@starkwang starkwang starkwang approved these changes
@oliyy oliyy oliyy approved these changes
Reviewers whose approvals may not affect merge requirements

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. child_process Issues and PRs related to the child_process subsystem.

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.

10 participants

@lundibundi @nodejs-github-bot @addaleax @lpinca @cjihrig @BridgeAR @starkwang @oliyy @trivikr @BethGriggs
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 01402775 — 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.