From b30c78581754fcc468c8dcaf2eb2c05fbcb2fcf1 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Sun, 25 Feb 2024 00:09:33 +0000 Subject: [PATCH] container: fix bug where argv[0] was not set properly --- container/src/init.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/container/src/init.rs b/container/src/init.rs index 0ad838d..4c0f495 100644 --- a/container/src/init.rs +++ b/container/src/init.rs @@ -380,7 +380,10 @@ impl ContainerInit { cmd.push("/bin/sh".to_string()); } - let path = cmd.remove(0); + let path = cmd + .first() + .ok_or_else(|| anyhow!("command is empty"))? + .clone(); let mut env = match config.env() { None => vec![], Some(value) => value.clone(),