pass container state to hooks over stdin and do some rafctoring#144
Merged
Conversation
- Add new socket class with socketAddress for generic socket operations - Rename unixSocketClient to unix_socket - Change unix_socket from inheritance to composition of socket - Remove utils/socket.h in favor of the new socket class - Add unix_socket::pair() for creating socket pairs - Add byte stream operators (<<, >>) to unix_socket Signed-off-by: ComixHe <ComixHe1895@outlook.com>
- Add npos constant for subspan sentinel value - Add operator[] for element access - Add begin()/end() for iterator support Signed-off-by: ComixHe <ComixHe1895@outlook.com>
Complete the OCI hooks state-passing logic and fix several bugs:
- Pass container state JSON to hooks over stdin as required by OCI spec
- Fix socketpair created after fork (child had no socket)
- Fix env variable concatenation bug ('+' was pointer arithmetic)
- Fix waitpid EINTR/EAGAIN condition (&& should be ||)
- Add hook timeout support via sigtimedwait
- Fix poststop_hooks iterating over wrong hook list (poststart)
- Update all hook call sites to pass container_status_t
Also adapt to the new socket API:
- Replace unixSocketClient with unix_socket
- Use unix_socket::pair() instead of utils::socketpair()
- Use STDIN_FILENO/STDOUT_FILENO instead of utils::fileno()
- Update SPDX copyright years to 2026
Signed-off-by: ComixHe <ComixHe1895@outlook.com>
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.
No description provided.