mirror of
https://github.com/vhaudiquet/ecrou.git
synced 2026-11-12 22:22:44 +00:00
fix(vm): a single quoted payload argument runs through the image's shell
'ecrou run alpine -- "apk add x && y"' reached the guest as one argv element and execvp'd a program named after the whole line. One argument containing whitespace is a quoted shell line: hand it to the image's shell as 'sh -c'. Argv vectors stay literal, including ones that begin with sh -c.
This commit is contained in:
1 parent
2e91db9acc
commit
a27879dbe7
3 files changed
+81
-7
No files matched your search
@@ -29,7 +29,9 @@ pub enum Command {
|
||||
pub struct RunArgs {
|
||||
/// Distribution name or OCI image reference
|
||||
pub image: String,
|
||||
/// Command to run in the machine; the image's default shell when omitted
|
||||
/// Command to run in the machine; the image's default shell when
|
||||
/// omitted. An argument vector after `--` is taken literally; a
|
||||
/// single quoted line runs through the image's shell.
|
||||
#[arg(last = true)]
|
||||
pub command: Vec<String>,
|
||||
/// Directory to share into the machine as HOST:GUEST[:ro] (repeatable)
|
||||
|
||||
Reference in new issue
Block a user