fix(node): scope raw descriptor adoption - #36349
Open
nathanwhit wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Details
TCPWrap.open()andPipeWrap.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 denocargo test -p deno_io fd_table --libcargo test -p deno_node --libcargo test -p deno_process --libcargo test -p specs_tests --test specs -- specs::node::pipe_open_fdcargo test -p specs_tests --test specs -- specs::node::net_socket_fd::tcp_opencargo test -p unit_node_tests --test unit_node -- unit_node::child_process_test./tools/format.js --check