rustjail: close stdin in execute_hook after it was sent

So that hook program could receive EOF.

Signed-off-by: Tim Zhang <tim@hyper.sh>
This commit is contained in:
Tim Zhang 2021-02-03 17:57:55 +08:00
parent bb08131151
commit d2041001ed

View File

@ -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