Commit 636f2d1
committed
feat(hooks): pass container state to hooks over stdin
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>1 parent 51ec713 commit 636f2d1
10 files changed
Lines changed: 188 additions & 131 deletions
File tree
- src/linyaps_box
- command
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
0 commit comments