-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add fallback for unsupported abstract sockets #278
Add fallback for unsupported abstract sockets #278
Commits on Sep 19, 2022
-
docs(sockctl): document generate_socket_name()
Add docs describing that generate_socket_name() returns a pseudo-random _abstract_ socket name, without the leading ␀-char.
Configuration menu - View commit details
-
Copy full SHA for 1ce4e17 - Browse repository at this point
Copy the full SHA 1ce4e17View commit details -
docs(sockctl): improve create_domain_client docs
Add details on what _abstract_ Unix domain sockets are, and that they're used when the input path is NULL.
Configuration menu - View commit details
-
Copy full SHA for 338c641 - Browse repository at this point
Copy the full SHA 338c641View commit details -
refactor(socketctl): make domain params const
These input variables are not changed, so we should make them const.
Configuration menu - View commit details
-
Copy full SHA for b00f855 - Browse repository at this point
Copy the full SHA b00f855View commit details -
refactor(sockctl): clean up create_domain_*()
Combines variable definition and initialization, since we aren't using an old C89 compiler. Additionally, I've replaced all of the sockaddr_un initialisations with portable C default initializers, as memset() is explicitly not recommended as it isn't portable, see [manpage for netinet_in.h under APPLICATION USAGE][1] [1]: https://manpages.ubuntu.com/manpages/jammy/en/man7/netinet_in.h.7posix.html
Configuration menu - View commit details
-
Copy full SHA for e196ead - Browse repository at this point
Copy the full SHA e196eadView commit details -
refactor(sockctl): autobind abstract unix sockets
Instead of creating our own abstract address, using 8 random hex chars, we can use Linux's autobind feature to create a new **unused** abstract address consisting of 5 random hex chars. This is 3 less hex chars, however Linux's autobind feature ensures that the a new abstract address is always picked, unlike our custom generator, which may rarely create an abstract address that is already being used. See https://manpages.ubuntu.com/manpages/jammy/en/man7/unix.7.html for documentation on the "autobind feature".
Configuration menu - View commit details
-
Copy full SHA for 390c321 - Browse repository at this point
Copy the full SHA 390c321View commit details -
feat(sockctl): add close_domain_socket function
Creates a helper function that can be used to: - close a unix domain socket, and - unlink() the unix domain socket (if _pathname_ unix domain socket) I've modified the `close()` function after every create_domain_client(NULL) to instead call `close_domain_socket()`.
Configuration menu - View commit details
-
Copy full SHA for b8d674b - Browse repository at this point
Copy the full SHA b8d674bView commit details
Commits on Sep 20, 2022
-
Configuration menu - View commit details
-
Copy full SHA for f34c098 - Browse repository at this point
Copy the full SHA f34c098View commit details -
feat(sockctl): support temp pathname unix sockets
Currently, creating a temporary unix domain socket using `create_domain_client(NULL)` creates an abstract Unix domain socket, which only works on Linux. In order to support FreeBSD (and other Unix not-Linux platforms), `create_domain_client(NULL)` can now fallback to creating a new _pathname_ unix domain socket using `mkdtemp()`.
Configuration menu - View commit details
-
Copy full SHA for ba72733 - Browse repository at this point
Copy the full SHA ba72733View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9ccb5ad - Browse repository at this point
Copy the full SHA 9ccb5adView commit details -
fix(sockctl): log when deleting tmp folders
There's a very tiny chance that we'll misidentify a folder as a mkdtemp folder created by `create_tmp_domain_socket_path()`. For this case, I've added a log statement. It's only a log_debug(), since we expect that if this ever does misidentify a folder, rmdir() will throw an ENOTEMPTY (dir not empty) error, which will print an error log message.
Configuration menu - View commit details
-
Copy full SHA for ae16f1c - Browse repository at this point
Copy the full SHA ae16f1cView commit details