Commit Graph
31 Commits
Author SHA1 Message Date
gabrielhnfandDaniel Hofstetter 840c36d396 shred: fix --remove=unlink with relative paths 2026-05-30 10:44:52 +02:00
Yuri AstrakhanandGitHub 2a7f318a1d chore: clippy::unreadable_literal (#10717) 2026-02-04 22:56:45 +01:00
naoNao89andSylvestre Ledru 31b5cc10dc fix(shred): stop immediately on write errors (fixes #7947)
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
2025-12-26 23:55:40 +01:00
Sylvestre Ledru dd21d7f6dd shred: ensure deterministic pass sequence compatibility with reference implementation
should fix tests/shred/shred-passes.sh
2025-12-20 11:18:28 +01:00
Sylvestre Ledru 71b4de24e6 test: improve support non-utf-8 2025-08-14 10:54:04 +02:00
Sylvestre Ledru 0e4ed4d462 Fix shred to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Dorian Peron 6e23d4e979 tests: patch tests to simplify imports 2025-07-01 03:36:46 +02:00
Sylvestre Ledru 6287c7bfa9 l10n: port shred for translation + add french 2025-06-26 08:06:01 +02:00
Ben WiederhakeandSylvestre Ledru 5a8fad8443 shred: implement and test feature --random-source 2025-05-19 11:17:55 +02:00
Daniel Hofstetter e378558996 shred: remove obsolete test 2025-04-24 09:25:11 +02:00
Jeremy SmartandGitHub b151e039ae shred: fix random passes* (#7830)
* shred: fix random passes, update documentation, add test

* shred: update tests
2025-04-24 09:15:36 +02:00
d7d0f9da7a shred: correctly print zero-byte pass in verbose mode (#7800)
Fixes #7798.

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2025-04-21 11:06:06 +02:00
Ben Wiederhake af7a939b62 shred: remove unwanted padding in verbose messages
This is tested for in the GNU shred-passes test, so we don't have a
choice if we want to stay compatible.
2025-04-20 18:28:23 +02:00
Yuri Astrakhan a27880e8a3 chore: use assert_eq! and assert_ne! instead of assert!
Makes intent clearer, and if something fails, prints the values that caused the failure as part of the panic message.
2025-04-08 13:25:41 -04:00
Sylvestre Ledru a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Daniel Hofstetter df4dfea852 tests: replace run() with succeeds() or fails() 2025-03-09 16:53:56 +01:00
Sylvestre Ledru 18cb7dcf9e Use the new function fails_with_code
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Ben Wiederhake 70d84e168c shred: accept shortcuts for stringly-enum arguments 2024-04-14 15:39:46 +02:00
Sylvestre Ledru cf3fe0e566 shred: small improv on the tests 2024-03-23 12:22:32 +01:00
Sylvestre Ledru bb5111cc71 shred: fails in case of permissions issue 2024-03-23 12:22:32 +01:00
Sylvestre Ledru f410d0967f shred: if the file is empty, don't run passes on it 2024-03-23 12:22:32 +01:00
Kostiantyn HryshchukandGitHub c867d6bfb1 shred: implemented "--remove" arg (#5790) 2024-01-06 22:50:21 +01:00
Sylvestre Ledru bfca6bf70f Add license headers on all files 2023-08-21 10:49:27 +02:00
Kostiantyn Hryshchuk 7306be6e58 fixed shred -u for windows
fixed shred panic on windows
2023-06-18 17:12:10 +02:00
John Shin f8a46196ef shred: add support for hex and octal size 2023-05-29 20:17:13 -07:00