Skip to content

[codex] honor child_process uid gid options#4298

Draft
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-uid-gid
Draft

[codex] honor child_process uid gid options#4298
andrewtdiz wants to merge 1 commit into
PerryTS:mainfrom
andrewtdiz:codex/node-compat-child-process-uid-gid

Conversation

@andrewtdiz
Copy link
Copy Markdown
Contributor

@andrewtdiz andrewtdiz commented Jun 3, 2026

Summary

  • add child_process parity coverage for uid/gid across spawn, spawnSync, execFileSync, and fork when running as root
  • apply numeric uid and gid options through the shared child_process command setup
  • set gid before uid on Unix so dropped-privilege children observe the supplied identities

Root Cause

Perry parsed common child_process options such as cwd and env, but ignored uid and gid. Node applies these IDs before exec, so root-launched children should observe the supplied IDs via process.getuid() and process.getgid().

Validation

  • npm exec --yes --package=node@26 -- node --experimental-strip-types test-parity/node-suite/child_process/async/uid-gid.ts
  • Baseline check before the fix: focused parity reported Node.js: spawn uid gid: 65534:65534 and Perry: spawn uid gid: 0:0
  • npm exec --yes --package=node@26 -- bash -lc "./run_parity_tests.sh --suite node-suite --module child_process --filter uid-gid"
  • npm exec --yes --package=node@26 -- bash -lc "./run_parity_tests.sh --suite node-suite --module child_process"
  • cargo fmt --all -- --check
  • git diff --check
  • ./scripts/check_file_size.sh

Covers the uid / gid option slice of #2555.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant