Skip to content

fix(arcup): verify_checksum_file rejects valid checksum files without a trailing newline - #460

Closed
UzairRehman4 wants to merge 1 commit into
circlefin:mainfrom
UzairRehman4:fix/arcup-checksum-trailing-newline
Closed

UzairRehman4 wants to merge 1 commit into
circlefin:mainfrom
UzairRehman4:fix/arcup-checksum-trailing-newline

Conversation

@UzairRehman4

Copy link
Copy Markdown

Summary

  • `read` returns a non-zero exit status when it hits EOF before a delimiter, even though it still populates the target variables from the partial final line
  • `verify_checksum_file` treated that non-zero exit status as "file is empty" and aborted, so a valid `.sha256` file lacking a trailing newline was rejected
  • Check whether `expected_checksum` is empty after the read instead of relying on `read`'s exit status; this still correctly rejects a genuinely empty checksum file

Fixes #420
Fixes #448

Test plan

  • Added a regression case to `test_checksum_validation` in `test_arcup.sh` covering a valid checksum file with no trailing newline, and a genuinely empty checksum file
  • Ran `bash arcup/test_arcup.sh` locally: all checksum-related tests pass (`ok - valid checksum file passes`, `ok - checksum filename mismatch fails`, `ok - valid checksum file without trailing newline passes`, `ok - empty checksum file fails`)

… a trailing newline

read(1) returns a non-zero exit status when it hits EOF before a
delimiter, even though it still populates the target variables from
the partial final line. verify_checksum_file treated that non-zero
status as "file is empty" and aborted, so any .sha256 file lacking a
trailing newline (e.g. produced by some tools' sha256sum output) was
rejected even though it contained a valid checksum.

Check whether expected_checksum ended up empty instead of relying on
read's exit status, which still correctly rejects a genuinely empty
checksum file.

Fixes circlefin#420, Fixes circlefin#448

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Hi @UzairRehman4,

Thank you for your interest in contributing to Arc Node.

This PR has been automatically closed because you are not assigned to issue #420. We require contributors to be explicitly assigned to an issue before submitting a PR.

To contribute properly:

  1. Comment on issue arcup: verify_checksum_file rejects a valid checksum file that has no trailing newline #420 requesting assignment
  2. Wait for maintainer approval
  3. Only submit a PR after you have been assigned

Please see our CONTRIBUTING.md for more details.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Unsigned Commits Detected

The following commits are missing a verified signature:

  • aaabb5c by Uzair Rehman

How to fix: Sign your commits.

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

Projects

None yet

1 participant