fix(host): query package allowlist without literal quotes

This commit is contained in:
archipelago
2026-08-31 10:44:15 -04:00
parent 5b6d278c46
commit b300a720db
+4 -5
View File
@@ -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