Skip to content

fix(node): scope raw descriptor adoption - #36349

Open
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/node-raw-descriptor-adoption
Open

fix(node): scope raw descriptor adoption#36349
nathanwhit wants to merge 1 commit into
denoland:mainfrom
nathanwhit:fix/node-raw-descriptor-adoption

Conversation

@nathanwhit

Copy link
Copy Markdown
Member

Summary

  • distinguish isolate-registered descriptors from untracked process descriptors
  • register pipe and child-process descriptors before handing them to Node stream wrappers
  • preserve stdio, inherited extra-stdio, and fully-authorized raw descriptor compatibility

Details

TCPWrap.open() and PipeWrap.open() previously treated any untracked OS descriptor as available for adoption. The OS descriptor table is process-wide, while Deno's descriptor tracking is isolate-local, so an untracked number may belong to a different isolate.

This change adds an explicit adoptable state for descriptors produced for the current isolate. Unknown non-stdio descriptors are rejected unless the isolate has all permissions, preserving the existing raw-descriptor compatibility path for fully-authorized programs. Successful adoption remains one-time.

Validation

  • cargo build -p deno --bin deno
  • cargo test -p deno_io fd_table --lib
  • cargo test -p deno_node --lib
  • cargo test -p deno_process --lib
  • cargo test -p specs_tests --test specs -- specs::node::pipe_open_fd
  • cargo test -p specs_tests --test specs -- specs::node::net_socket_fd::tcp_open
  • cargo test -p unit_node_tests --test unit_node -- unit_node::child_process_test
  • ./tools/format.js --check

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