Skip to content

initrd-shell: fix await_condition command execution - #123

Open
jaybent wants to merge 1 commit into
random-archer:masterfrom
jaybent:fix_argv_flattening
Open

initrd-shell: fix await_condition command execution#123
jaybent wants to merge 1 commit into
random-archer:masterfrom
jaybent:fix_argv_flattening

Conversation

@jaybent

@jaybent jaybent commented May 19, 2026

Copy link
Copy Markdown

This fixes #122 which identifies two related bugs in the initrd runtime shell path:

  1. await_condition() flattens its command arguments into a scalar with local command="$*" and later executes $command unquoted. This loses argv boundaries and makes the condition sensitive to word splitting and pathname expansion.

  2. await_secret_validated() passes [[ ! has_crypt_jobs ]] as if it were a command. That does not call has_crypt_jobs; inside [[ ... ]], has_crypt_jobs is a non-empty string, so the expression is always false.

The fix is to execute "$@" directly in await_condition() and introduce a small has_no_crypt_jobs() predicate for the negated condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

initrd-shell: await_condition flattens argv and await_secret_validated never calls has_crypt_jobs

1 participant