Skip to content

Commit

Permalink
rustjail: close stdin in execute_hook after it was sent
Browse files Browse the repository at this point in the history
So that hook program could receive EOF.

Signed-off-by: Tim Zhang <tim@hyper.sh>
  • Loading branch information
Tim-Zhang committed Feb 3, 2021
1 parent bb08131 commit d204100
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/agent/rustjail/src/container.rs
Expand Up @@ -1602,6 +1602,9 @@ async fn execute_hook(logger: &Logger, h: &Hook, st: &OCIState) -> Result<()> {
.write_all(state.as_bytes())
.unwrap();

// Close stdin so that hook program could receive EOF.
child.stdin.take();

// read something from stdout for debug
let mut out = String::new();
child
Expand Down

0 comments on commit d204100

Please sign in to comment.