This repository was archived by the owner on Feb 10, 2023. It is now read-only.
Repository navigation
Set SOCK_CLOEXOEC for sockets - #35
Merged
Merged
Conversation
I've tried to do a normal interface, with ability to set it optinally, but it is not that trivial, anyway creating socket w/o SOCK_CLOEXEC is almost always an error (it is not a pipe/socketpair that may be used to shared data between child and parent). Follow-up for: ClickHouse/ClickHouse#9174
This was referenced Mar 13, 2021
azat
added a commit
to azat/ClickHouse
that referenced
this pull request
Mar 13, 2021
Found this in [1]:
[Detaching after fork from child process 184152]
...
Cannot get server pid with {}, got {}: {} lsof -i tcp:9000 -s tcp:LISTEN -Fp | awk '/^p[0-9]+$/{print substr($0, 2)}' b'301\n184152\n' invalid literal for int() with base 10: b'301\n184152\n'
But the major idea is that parent process should not export any file
descriptors to childrens, otherwise this may create security and other
breaches (like extra pipe endpoints, ...)
[1]: https://clickhouse-test-reports.s3.yandex.net/21511/d7d9638ceb6bd702f34a88ee54f8f83197e90af5/stress_test_(address).html#fail1
Refs: ClickHouse/poco#35
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I've tried to do a normal interface, with ability to set it optinally,
but it is not that trivial, anyway creating socket w/o SOCK_CLOEXEC is
almost always an error (it is not a pipe/socketpair that may be used to
shared data between child and parent).
Follow-up for: ClickHouse/ClickHouse#9174