Summary
verify_checksum_file in arcup/arcup reads both hash and filename from the .sha256 file:
if ! read -r expected_checksum expected_name < "$checksum_path"; then
error "Checksum file is empty: $checksum_path"
fi
The filename validation is guarded by:
if [[ -n "$expected_name" ]]; then
...
fi
If the .sha256 file contains only a bare hash (no filename field), expected_name is empty and the filename cross-check is silently skipped. The archive is accepted purely on hash match, without verifying the checksum file was intended for this specific archive name.
Impact
Low in practice (GitHub release .sha256 files always include the filename), but the function's contract "verify this checksum file is for $archive_name" is silently violated for bare-hash inputs.
Fix
Add an elif [[ -n "$archive_name" ]]; then error "..." branch to require the filename field when archive_name is provided:
elif [[ -n "$archive_name" ]]; then
error "Checksum file contains no filename field; expected '$archive_name'"
fi
Summary
verify_checksum_fileinarcup/arcupreads both hash and filename from the.sha256file:The filename validation is guarded by:
If the
.sha256file contains only a bare hash (no filename field),expected_nameis empty and the filename cross-check is silently skipped. The archive is accepted purely on hash match, without verifying the checksum file was intended for this specific archive name.Impact
Low in practice (GitHub release
.sha256files always include the filename), but the function's contract "verify this checksum file is for$archive_name" is silently violated for bare-hash inputs.Fix
Add an
elif [[ -n "$archive_name" ]]; then error "..."branch to require the filename field whenarchive_nameis provided: