Skip to content

fix(dstack-types): read the whole sha256sum filename, not its first token - #1366

Closed
kvinwang wants to merge 2 commits into
nextfrom
fix/dstack-types-sha256sum-filename
Closed

kvinwang wants to merge 2 commits into
nextfrom
fix/dstack-types-sha256sum-filename

Conversation

@kvinwang

@kvinwang kvinwang commented Sep 24, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

sha256sum_entry_hash took the filename as the second whitespace token and dropped the rest of the line. For <h1> measurement.tdx.cbor <h2> measurement.tdx.cbor it returned h1, while sha256sum -c (filename runs to end of line) matches neither entry, and the hidden second entry escaped the duplicate check. sha256sum.txt is what os_image_hash commits to, so this parser and sha256sum -c / a human reviewer should agree on what it says. Found by property tests (#1249).

Fix

Split on the first whitespace run and take the rest of the line as the filename. Well-formed <hash> <name> manifests parse identically.

Verification

Regression test added; cargo test -p dstack-types passes; fmt and clippy clean.

@kvinwang

Copy link
Copy Markdown
Collaborator Author

Superseded by 8a71300 on next, which parses sha256sum.txt with one strict grammar.

@kvinwang kvinwang closed this Sep 24, 2026
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.

1 participant