fix(host): query package allowlist without literal quotes
This commit is contained in:
@@ -131,11 +131,10 @@ async fn run_host_fixups() -> Result<()> {
|
|||||||
/// install without `apt-get update` first; only if that fails (fresh suite,
|
/// install without `apt-get update` first; only if that fails (fresh suite,
|
||||||
/// stale index), update once and retry. Both under timeout, both non-fatal.
|
/// stale index), update once and retry. Both under timeout, both non-fatal.
|
||||||
async fn ensure_packages() -> Result<bool> {
|
async fn ensure_packages() -> Result<bool> {
|
||||||
let wanted = HOST_PACKAGES
|
// Package names are a fixed internal allowlist. Do not embed shell quote
|
||||||
.iter()
|
// characters in WANTED: quotes produced by variable expansion are data,
|
||||||
.map(|p| format!("'{p}'"))
|
// so dpkg-query would look for a package literally named 'kdump-tools'.
|
||||||
.collect::<Vec<_>>()
|
let wanted = HOST_PACKAGES.join(" ");
|
||||||
.join(" ");
|
|
||||||
let script = format!(
|
let script = format!(
|
||||||
r#"
|
r#"
|
||||||
set -u
|
set -u
|
||||||
|
|||||||
Reference in New Issue
Block a user