-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't pass socket file descriptors to subprocesses on Unix (SOCK_CLOEXEC
)
#14632
Don't pass socket file descriptors to subprocesses on Unix (SOCK_CLOEXEC
)
#14632
Conversation
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.
Searching the history, I think we never had it. Let's fix that!
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.
This seems like the right thing to do. It was probably just missed in the original implementation.
suggestion: Add comments with cross-references between the different implementations in create_handle
and initialize_handle
.
I'm also wondering if the fcntl
part shouldn't be moved to create_handle
, but that's a different issue.
suggestion: Add a simple spec to ensure this doesn't get lost somewhere. A simple check for it "socket closes on exec by default" do
socket = Socket.new(Socket::Family::INET, Socket::Type::STREAM, Socket::Protocol::TCP)
socket.close_on_exec?.should be_true
end |
I disabled the spec for windows. This is an UNIX only consideration. |
We still need to take a look at the Windows stuff. I've created #14636 to track that. |
SOCK_CLOEXEC
)
The comment 8 lines down suggests that this has been lost at some point.
Fixes #14630