Skip to content

b2sum: report malformed status input - #12622

Merged
sylvestre merged 1 commit into
uutils:mainfrom
wondr-wclabs:codex/b2sum-status-malformed-input
Sep 22, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
wondr-wclabs:codex/b2sum-status-malformed-input

Conversation

@wondr-wclabs

@wondr-wclabs wondr-wclabs commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

What changed

b2sum -c --status now still reports the structural error when the checksum input contains no properly formatted checksum lines.

The change is in the shared checksum validator: the no properly formatted checksum lines found diagnostic is no longer hidden by ChecksumVerbose::Status. Regular checksum mismatches under --status remain silent; only the “there was nothing valid to check” diagnostic is surfaced.

Why

GNU b2sum -c --status reports this case because it is not a per-file mismatch result, it is an invalid checksum-list input. The previous logic treated it like other status-mode output and suppressed the diagnostic, leaving only the exit code.

Fixes #12590.

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/df/skip-rootfs. tests/df/skip-rootfs is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/id/smack. tests/id/smack is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-root. tests/mkdir/smack-root is passing on 'main'. Maybe you have to rebase?

@wondr-wclabs

Copy link
Copy Markdown
Contributor Author

I inspected the failing macOS localization job. The failure is in test_touch::test_touch_changes_time_of_file_in_stdout:

touch: setting times of '-': Bad file descriptor

This PR only changes src/uucore/src/lib/features/checksum/validate.rs and tests/by-util/test_b2sum.rs, so that touch - failure is outside the changed code path. The native GNU comparison comment also only reports unrelated intermittent tail skips plus unrelated improvements (dd/no-allocate, seq-epipe).

I do not see a b2sum/checksum regression to fix here. If the macOS touch - failure repeats on main/other PRs, it looks like it should be handled separately from this checksum-status-input change.

@sylvestre

Copy link
Copy Markdown
Contributor

The Validation section is useless, please don't add it in the future

@wondr-wclabs

Copy link
Copy Markdown
Contributor Author

Agreed. I removed the Validation section from the PR body.

For uutils PR openings I will keep the description focused on the behavior change, compatibility rationale, and linked issue. I will only mention local commands later when they are directly useful for review, for example explaining a CI discrepancy or documenting a targeted check after a requested change.

@sylvestre

Copy link
Copy Markdown
Contributor

@wondr-wclabs I would also appreciate you don't use a llm to reply to me...

@wondr-wclabs
wondr-wclabs force-pushed the codex/b2sum-status-malformed-input branch from 6119e6b to 246db35 Compare June 6, 2026 00:48
@HackingRepo

Copy link
Copy Markdown
Contributor

#12867

@HackingRepo

HackingRepo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

update the pr title b2sum: report malformed status input to hashsum: report malformed status input

@sylvestre

Copy link
Copy Markdown
Contributor

the fix landed in a different PR but without a test like yours!

@sylvestre
sylvestre enabled auto-merge (rebase) September 19, 2026 22:03
@sylvestre
sylvestre force-pushed the codex/b2sum-status-malformed-input branch from accff59 to 841195d Compare September 21, 2026 12:57
@sylvestre
sylvestre disabled auto-merge September 22, 2026 12:55
@sylvestre
sylvestre merged commit 240ce3b into uutils:main Sep 22, 2026
89 of 90 checks passed
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.

bug(b2sum): b2sum uutils show no error when providing an invalid hash and the option -c and --status

3 participants