-
Notifications
You must be signed in to change notification settings - Fork 150
fix(arcup): guard curl 8.14.x retry/exit-code bug in download paths #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
cb26369
384833d
59f2557
bdcfc7d
682d6a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ set -euo pipefail | |
|
|
||
| # NOTE: if you make modifications to this script, please increment the version number. | ||
| # WARNING: the SemVer pattern: major.minor.patch must be followed as we use it to determine if the script is up to date. | ||
| ARCUP_INSTALLER_VERSION="0.2.0" | ||
| ARCUP_INSTALLER_VERSION="0.2.1" | ||
|
|
||
| REPO="${ARC_REPO:-circlefin/arc-node}" | ||
| if [[ -n "${ARC_REPO:-}" ]] && [[ ! "$ARC_REPO" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]; then | ||
|
|
@@ -324,7 +324,7 @@ download_file() { | |
| return | ||
| fi | ||
|
|
||
| if ! curl_with_headers -#fL --max-time 900 -o "$output_path" "$url"; then | ||
| if ! curl_with_headers -#fL --max-time 900 -o "$output_path" "$url" || [[ ! -s "$output_path" ]]; then | ||
| rm -f "$output_path" | ||
| download_error "$tag" "$filename" "$url" | ||
| fi | ||
|
|
@@ -350,7 +350,7 @@ download_file_with_github_api() { | |
| download_url=$(resolve_github_asset_download_url "$asset_api_url") || return 1 | ||
|
|
||
| if curl "${CURL_RETRY_ARGS[@]}" -fL --max-time 900 -o "$output_path" "$download_url" >/dev/null 2>&1; then | ||
| [[ -f "$output_path" ]] && return 0 | ||
| [[ -s "$output_path" ]] && return 0 | ||
| fi | ||
|
|
||
| rm -f "$output_path" | ||
|
|
@@ -374,7 +374,7 @@ download_file_with_gh() { | |
| --dir "$output_dir" \ | ||
| --clobber \ | ||
| >/dev/null 2>&1; then | ||
| [[ -f "$output_path" ]] && return 0 | ||
| [[ -s "$output_path" ]] && return 0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a fourth production change that isn't in the PR summary's three bullets, and it's the only changed call site with no regression test. It's also not the curl 8.14.x bug — this branch shells out to No correctness objection; |
||
| fi | ||
|
|
||
| rm -f "$output_path" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,7 +72,7 @@ main() { | |
| error "curl not found. Please install curl." | ||
| fi | ||
|
|
||
| if ! curl_with_headers -#fL --max-time 300 -o "$_INSTALL_TMP_FILE" "$ARCUP_URL" ; then | ||
| if ! curl_with_headers -#fL --max-time 300 -o "$_INSTALL_TMP_FILE" "$ARCUP_URL" || [[ ! -s "$_INSTALL_TMP_FILE" ]]; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the change that carries the actual severity, and the PR body is right to single it out: there is no checksum, signature or archive-integrity step anywhere in Heads-up on overlap: this hunk is byte-identical to the one in #314, which is also open and also closes #309. I tested it — #314 merges clean onto main and this PR merges clean on top, so nothing will break either way, but merging both is redundant. #318 is a superset of #314's fix except for the |
||
| error "failed to download arcup from '$ARCUP_URL'" | ||
| fi | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Verified this path is genuinely in scope:
curl_with_headers(arcup:79–84) prependsCURL_RETRY_ARGS=(--retry 3 ...)on both branches, so the 8.14.x exit-code bug can fire here.Worth noting for reviewers weighing severity: an empty archive reaching this point would still be caught downstream by
verify_checksum_fileandtar -tzf, so this one fails safe today. The guard's real value is converting a confusing downstream checksum error into an accurate failure at the point it actually happened. Correct change, lower severity than install:75.