Skip to content

Conversation

@naoNao89
Copy link
Contributor

Fixes #7947

Replace show_if_err!() with ? operator in wipe_file() to properly propagate errors and stop immediately on write failures, matching GNU shred. Previously continued all passes despite errors. Enables previously ignored test test_random_source_dir.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/overlay-headers (fails in this run but passes in the 'main' branch)

@naoNao89 naoNao89 force-pushed the fix/issue-7947-shred-error-handling branch from 0b0877a to b805fbd Compare December 13, 2025 12:42
Replace show_if_err!() with ? operator in wipe_file() to properly
propagate errors and stop pass loop on first write failure.

This matches GNU shred behavior where any write error (disk quota,
I/O error, etc.) stops execution immediately instead of continuing
with remaining passes.

Changes:
- src/uu/shred/src/shred.rs: Use ? operator for error propagation
- tests/by-util/test_shred.rs: Enable previously ignored test
@naoNao89 naoNao89 force-pushed the fix/issue-7947-shred-error-handling branch from b805fbd to 9f96b95 Compare December 13, 2025 12:45
@uutils uutils deleted a comment from github-actions bot Dec 26, 2025
@sylvestre sylvestre merged commit 31b5cc1 into uutils:main Dec 26, 2025
127 checks passed
@naoNao89 naoNao89 deleted the fix/issue-7947-shred-error-handling branch December 27, 2025 20:10
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.

shred: Continues after encountering an error

2 participants