Skip to content
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

ext/sockets: socket_accept setting fcntl's FD_CLOEXEC on unixes. #14606

Closed
wants to merge 1 commit into from

Conversation

devnexen
Copy link
Member

mainly for scenarios when pcntl_fork/pcntl_exec are involved so when the latter is executed, we avoid unwarranted effects with the file descriptors, instead the socket will be closed on success.

mainly for scenarios when pcntl_fork/pcntl_exec are involved so when
the latter is executed, we avoid unwarranted effects with the file
descriptors, instead the socket will be closed on success.
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should indeed correctly set the flag, but I wonder if anyone relies on the descriptor surviving exec.

@devnexen
Copy link
Member Author

devnexen commented Jul 1, 2024

I know no one ; however "better safe than sorry" :) I think it does not kill doing so regardless.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah and if it does break, albeit unlikely, it shouldn't be a big deal to revert this or come up with a solution.

@devnexen devnexen closed this in 1bcb57d Jul 1, 2024
@bukka
Copy link
Member

bukka commented Jul 5, 2024

Yeah this might break some applications but worth to try it. Socket is not probably that much used so it's good first candidate to try , might be more tricky for streams though.

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

Successfully merging this pull request may close these issues.

None yet

3 participants