Commit Graph
119 Commits
Author SHA1 Message Date
Ibrahim Burak YorulmazandSylvestre Ledru e5a6b519ad tests/dd: test supplying non-positive bs/ibs/cbs/obs 2026-04-20 23:12:56 +02:00
oech3andGitHub 1d3dba8261 remove seekable from local cspell conf and use it (#11773) 2026-04-12 16:22:34 +02:00
Ibrahim Burak YorulmazandGitHub db9a111c18 dd: do not show zero multiplier warning when zero is the multiplicand (#11673)
* dd: do not show zero multiplier warning when zero is the multiplicand

* tests/dd: test zero multiplier warning when zero is the multiplicand
2026-04-06 08:16:40 +02:00
oech3andSylvestre Ledru 0beca7cb84 dd: catch OOM 2026-03-31 22:18:15 +02:00
Sylvestre LedruandGitHub 36b5e59329 dd: fix ISO-8859-1 case conversion for conv=lcase/ucase (#10830) 2026-03-10 13:27:24 +01:00
Yuri AstrakhanandGitHub 2a7f318a1d chore: clippy::unreadable_literal (#10717) 2026-02-04 22:56:45 +01:00
✿ Fleur de BlueandGitHub 2a2cafdbd4 Re-enable unused_qualifications lint (#10571) 2026-02-03 21:55:21 +01:00
Sylvestre LedruandGitHub cd288fc401 ci: ensure test failures are caught in coverage script and fix them (#10286) 2026-01-17 10:20:39 -05:00
7eb78ab860 dd: get rid of line buffered stdout (#10235)
* dd: get rid of line-buffered stdout

Line-buffered stdout causes partial write and read operations in dd,
which is an issue when writing binary data to stdout. Partial writes can
lead to data loss and require passing iflag=fullblock to ensure that the
exact number of bytes is read.

* dd: Add test to check for dropped writes

(cherry picked from commit 0f7c53111df8b945bdb06217396b332f24a42100)

* Fix build on Windows

* dd: use OwnedFileDescriptorOrHandle

OwnedFileDescriptorOrHandle can be used to bypass the LineWriter
that is used by default for Stdout.

* Run test_no_dropped_writes only on unix

---------

Co-authored-by: Adrian Kretz <me@akretz.com>
2026-01-17 08:18:24 -05:00
Chris DrydenandGitHub 5fc9f8e7e0 dd: use seek for stdin skip when possible (#9821)
* dd: use seek for stdin skip when possible

* Add Rust tests for skip with seekable stdin

* Address review comments: fix return value, add comment, refactor tests

* dd: use ibs-sized buffer for ESPIPE fallback in skip
2026-01-13 18:59:21 +01:00
2da2c90dd7 dd: fix nocache flag handling at EOF (#9818)
* dd: fix nocache flag handling at EOF

* Add tests for nocache EOF handling

---------

Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
2026-01-05 18:02:37 +01:00
DavidandGitHub 1fca82965d dd: should terminate with error if skip argument is too large (#7275)
fixed clippy warning
2025-12-20 19:04:12 +01:00
naoNao89 bcba024628 fix(dd): handle O_DIRECT partial block writes
Fix dd failures with 'IO Error: Invalid input' when using
oflag=direct with partial blocks. The issue occurs because O_DIRECT requires
proper alignment for all writes, but the final partial block may not meet
these requirements.

This fix:
- Detects EINVAL errors that might be O_DIRECT alignment issues
- Temporarily removes O_DIRECT flag using fcntl(F_SETFL)
- Retries the write operation without the direct flag
- Restores original flags (safer than GNU approach)
- Only activates on Linux/Android platforms where O_DIRECT is supported

Matches GNU dd behavior discovered through strace analysis.
2025-10-26 07:09:04 +07:00
Martin Kunkel e41c1405c9 Add devcontainer setup and small related fixes
- Added devcontainer configuration based on Ubuntu 24.04
- Added GitHub Actions workflow for devcontainer testing
- Update cSpell configuration to ingore spelling in devcontainer configs
- Update pre-commit hooks to exclude cSpell.json because pre-commit
  fails for that file due to json with comments format
- Fix filename for cSpell config in vscode settings
- Two tests in `test_dd.rs` are now skipped if /dev/sda1 is not
  available, which is the case in devcontainer
- Update check for existing gnu clone in build-gnu.sh, not checking the
  existence of the directory but the presence of the .git directory.
  This allows us to have the directly as a volume mount in devcontainer
- Remove temporary file `g` after use in build-gnu.sh
2025-08-18 07:34:16 +00:00
Sylvestre Ledru 968fc85efd l10n: address review comments 2025-08-13 15:28:20 +02:00
Sylvestre Ledru 688215725c l10n: port dd for translation + add french 2025-06-28 21:52:00 +02:00
Luv-RayandGitHub fb2399f56b fix clippy (#8275)
* fix clippy

* update

* update
2025-06-27 09:15:24 +02:00
Yuri Astrakhan 982805d3cd chore: manual inline formatting
Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-08 00:23:21 -04:00
Daniel Hofstetter 5ab4968721 dd: fix "unused import" warning in test 2025-04-03 14:27:43 +02:00
Sylvestre Ledru a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Sylvestre Ledru 22fc5cf16b dd tests: fix 'temporary value dropped while borrowed' 2025-03-24 21:33:16 +01:00
Sylvestre Ledru a85539f530 Run cargo fmt on the tree 2025-03-24 21:33:12 +01:00
Sylvestre Ledru a193073556 disable some tests for now
Fails with:
```

---- test_ls::test_ls_color_norm stdout ----
touch: /tmp/.tmp9wbpVl/exe
touch: /tmp/.tmp9wbpVl/no_color
run: /home/runner.linux/work/target/debug/coreutils ls -gGU --color exe no_color
thread 'test_ls::test_ls_color_norm' panicked at tests/by-util/test_ls.rs:5307:10:
'norm exe
norm no_color
' does not contain 'norm exe
norm no_color'
---- test_ls::test_ls_inode stdout ----
touch: /tmp/.tmpiozh4d/test_inode
run: /home/runner.linux/work/target/debug/coreutils ls test_inode -i
run: /home/runner.linux/work/target/debug/coreutils ls test_inode
run: /home/runner.linux/work/target/debug/coreutils ls -li test_inode
thread 'test_ls::test_ls_inode' panicked at tests/by-util/test_ls.rs:2776:5:
assertion failed: re_long.is_match(result.stdout_str())
---- test_ls::test_ls_long_format stdout ----
mkdir: /tmp/.tmpDm1xDQ/test-long-dir
touch: /tmp/.tmpDm1xDQ/test-long-dir/test-long-file
mkdir: /tmp/.tmpDm1xDQ/test-long-dir/test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls -l test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --long test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --format=long test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --format=lon test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --for=long test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --format=verbose test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls --for=verbose test-long-dir
run: /home/runner.linux/work/target/debug/coreutils ls -lan test-long-dir
thread 'test_ls::test_ls_long_format' panicked at tests/by-util/test_ls.rs:1139:62:
Stdout does not match regex:
total 0
drwxr-xr-x+ 3 1001 1001 80 Mar 14 08:14 .
drwxr-xr-x+ 3 1001 1001 60 Mar 14 08:14 ..
drwxr-xr-x+ 2 1001 1001 40 Mar 14 08:14 test-long-dir
-rw-r--r-- 1 1001 1001  0 Mar 14 08:14 test-long-file
---- test_ls::test_ls_long_formats stdout ----
touch: /tmp/.tmpCHVj2X/test-long-formats
run: /home/runner.linux/work/target/debug/coreutils ls -l --author test-long-formats
thread 'test_ls::test_ls_long_formats' panicked at tests/by-util/test_ls.rs:1514:10:
Stdout does not match regex:
-rw-r--r--+ 1 runner runner runner 0 Mar 14 08:14 test-long-formats
failures:
    test_ls::test_ls_color_norm
    test_ls::test_ls_inode
    test_ls::test_ls_long_format
    test_ls::test_ls_long_formats
```
2025-03-14 11:54:52 +01:00
Sylvestre Ledru 117fea23ba selinux test: disable some tests (not a big deal) 2025-03-14 09:54:29 +01:00
Daniel Hofstetter df4dfea852 tests: replace run() with succeeds() or fails() 2025-03-09 16:53:56 +01:00