Skip to content

b2sum: report malformed status input#12622

Open
wondr-wclabs wants to merge 1 commit into
uutils:mainfrom
wondr-wclabs:codex/b2sum-status-malformed-input
Open

b2sum: report malformed status input#12622
wondr-wclabs wants to merge 1 commit into
uutils:mainfrom
wondr-wclabs:codex/b2sum-status-malformed-input

Conversation

@wondr-wclabs
Copy link
Copy Markdown

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

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
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

@wondr-wclabs
Copy link
Copy Markdown
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
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
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.

gnucompability(b2sum): b2sum uutils show no error but gnu b2sum show an error when the option -c and --status

2 participants