fix(arcup): reject empty bootstrap downloads - #314
Conversation
|
Reviewed this end to end and reproduced the underlying curl behaviour locally rather than taking #309 at face value. The fix is correct, the predicate is the right one, and the regression test is genuine. Details and a few follow-on observations below. The mechanism reproduces exactlyAgainst the real endpoint shape (raw.githubusercontent.com, missing path), using the script's own
The detail that matters for this PR: because Parsing is right too: The regression test genuinely fails without the fixReverting only the (exit 1) That output is worth pasting into the PR description, because it is the actual user-visible bug: a zero-byte file gets The scoping claim holds up — I checked the other paths"Intentionally scoped to the bootstrap silent-success path" is the right call, and it is defensible for a reason worth recording in the PR body: the other
Bootstrap is the only path that installs and executes an unverified payload with no downstream integrity check, which is precisely why it is the only one that silently succeeds. A sentence to that effect would stop the scope decision reading as arbitrary. One place I would still change, same idiom
if curl "${CURL_RETRY_ARGS[@]}" -fL --max-time 900 -o "$output_path" "$download_url" >/dev/null 2>&1; then
[[ -f "$output_path" ]] && return 0
fi
The test currently never runsNo workflow references arcup at all:
Related and concrete: Optional hardening
head -n1 "$_INSTALL_TMP_FILE" | grep -q '^#!' || error "downloaded arcup is not a script"Entirely optional, and arguably out of scope for a #309 fix. Very minor nit: Net: correct fix, real test, sensible scope. The |
Fixes #309.
Prevents the bootstrap installer from treating an empty download as successful when curl incorrectly returns exit code 0.
The installer now verifies that the downloaded temporary file is non-empty before installing it.
Adds a regression test reproducing the false-success behavior.
This is intentionally scoped to the bootstrap silent-success path.