Commit graph

4339 commits

Author SHA1 Message Date
Dorian Peron
69ce42c3cb test(cksum): add tests for --length, refactor tests 2025-10-28 03:06:19 +01:00
Dorian Peron
a95633e520 util(cksum): Fix gnu cksum-c.sh 2025-10-28 01:29:07 +01:00
Sylvestre Ledru
c85d8b5ed3
Merge pull request #9016 from naoNao89/fix/dd-oflag-direct-isolated
Some checks are pending
CICD / MinRustV (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Benchmarks / Run benchmarks (CodSpeed) (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
fix(dd): handle O_DIRECT partial block writes
2025-10-27 23:31:53 +01:00
Sylvestre Ledru
b5b8c28b4d
Merge pull request #9055 from akretz/fix-ls-acl
ls: use file path for ACL check
2025-10-27 23:13:19 +01:00
Adrian Kretz
a58b1bea55 test/ls: add test to verify ACL from different dir 2025-10-27 21:46:34 +01:00
Adrian Kretz
4a2890a07c test/chown: don't chown if user is in wheel group 2025-10-27 20:36:31 +01:00
Adrian Kretz
ce90685e8a test/chown: use wheel group on BSD 2025-10-27 19:35:31 +01:00
Daniel Hofstetter
870bc29cb4
Merge pull request #9022 from sylvestre/test-ignored-date
date: improve compat with GNU
2025-10-27 11:40:01 +01:00
Sylvestre Ledru
d87a5b88a3 date: support(Military timezone with optional hour offset 2025-10-27 10:31:01 +01:00
Sylvestre Ledru
5cae9ae53e date: -d empty string should be treated as midnight today 2025-10-27 10:31:01 +01:00
Sylvestre Ledru
284554658d date: add support for the 'J' military timezone 2025-10-27 10:30:43 +01:00
Sylvestre Ledru
b17129d8ee date: add ignored tests that passes with GNU and fails with Rust 2025-10-27 10:02:35 +01:00
Dorian Peron
3d8ad59b30 test(cksum): Add sha3 tests 2025-10-26 20:18:14 +01:00
Dorian Peron
87f61423af test(cksum): Add sha2 tests 2025-10-26 20:18:14 +01:00
Dorian Peron
7aa46dd9c7 test(cksum): nits on tests 2025-10-26 20:18:14 +01:00
Dorian Peron
dfda5e0d91 util(cksum): Add support for sha2 and sha3 2025-10-26 20:18:14 +01:00
Daniel Hofstetter
a00d3478e3
Merge pull request #9032 from RenjiSann/cksum-fix-len-zero
Fix "cksum: --length 0 shouldn't fail for algorithms that don't support --length"
2025-10-26 16:39:52 +01:00
Dorian Peron
4e9d07e86c util(cksum): Fix unexpected fail when giving --length 0 to wrong algorithm 2025-10-26 14:32:20 +01:00
Christopher Ada Armstrong
f7e639f8a2
Merge pull request #8930 from Ada-Armstrong/hashsum_continue_on_dirs
hashsum: don't fail on dirs
2025-10-26 14:25:00 +01:00
Cả thế giới là Rust
fd83181ac2
Fix EINTR handling in cat, od, and comm (#8946)
* fix: handle EINTR (signal interruptions) in cat, od, and comm

Add proper retry loops for ErrorKind::Interrupted in I/O operations
to handle signals like SIGUSR1 that can interrupt read/write calls.

This pattern is proven in production - identical to PR #6025 (merged
March 2024) which fixed dd's EINTR handling for GNU test dd/stats.sh.
The same pattern is already used in 9+ utilities (head, tail, tee, wc,
sort, sum, tr, shuf, dd) without issues.

Changes:
- cat: Fix write_fast() and write_lines() to retry on EINTR
- od: Fix PartialReader::read() in all three read paths
- comm: Fix are_files_identical() for both file readers
- tests: Add InterruptingReader/Writer test utilities

Historical context:
- Pattern validated by cre4ture's PR #6025 (dd EINTR fix)
- Matches existing implementations in dd/dd.rs:450,881
- POSIX best practice for signal-interrupted I/O

Fixes #1275

* fix: handle EINTR (signal interruptions) in cat, od, and comm

Add proper retry loops for ErrorKind::Interrupted in I/O operations to handle signals like SIGUSR1 that can interrupt read/write calls.

Pattern matches PR #6025 (dd EINTR fix) and is already used in 9+ utilities. Changes:
- cat: Fix write_fast() and write_lines() to retry on EINTR
- od: Fix PartialReader::read() in all three read paths
- comm: Fix are_files_identical() for both file readers
- tests: Add visible EINTR integration tests for CI

Addresses sylvestre's review feedback on code documentation and CI test visibility.

* style: apply cargo fmt formatting to EINTR changes

* test: fix EINTR integration test failures

- Fix comm test: use stdout_contains instead of stdout_only for tabbed output
- Fix od test: create new command instance to avoid 'already run this UCommand' error
- Remove unused imports and dead code to eliminate compiler warnings
- Both tests now pass without warnings or errors

* style: fix formatting and remove duplicate comment in od test

* ci: add EINTR and related technical terms to appropriate cspell dictionaries

- Add EINTR, eintr, nextest to jargon.wordlist.txt (technical/systems programming terms)
- Add SIGUSR, SIGINT, etc. to shell.wordlist.txt (POSIX signals)
- Add uutils, coreutils, ucmd, etc. to workspace.wordlist.txt (project-specific terms)
- Fixes CI cspell warnings for legitimate technical terminology
- Proper categorization follows existing dictionary structure
2025-10-26 13:59:47 +01:00
Sylvestre Ledru
aa172ae7df
Merge pull request #8944 from naoNao89/fix/issue-1882-date-set-formats
fix(date): support timezone abbreviations in date --set`
2025-10-26 12:41:14 +01:00
Sylvestre Ledru
82464a4259
Merge pull request #9024 from RenjiSann/checksum-updates
cksum: Refactor cksum for incoming merge with hashsum, Fix behavior for `--text` and `--untagged`
2025-10-26 12:31:22 +01:00
Dorian Peron
a4f4542467 util(cksum): Fix behavior with --text and --untagged, and prepare hashsum/cksum merge refactor 2025-10-26 12:06: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
Sylvestre Ledru
8867591716 mv: improve the verbose mode to make tests/mv/mv-special-1.sh pass 2025-10-24 00:00:21 +02:00
Sylvestre Ledru
3d6b0b2ea4
--version should just print the command name, not the path (#8921)
Some checks are pending
CICD / MinRustV (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Dependencies (push) Waiting to run
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Safe Traversal Security Check (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
Benchmarks / Run benchmarks (CodSpeed) (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
WSL2 / Test (push) Waiting to run
* --version should just print the command name, not the path

This will fix the parsing for old autoconf
Closes: #8880

* Update tests/by-util/test_mkdir.rs

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-10-23 10:23:51 +02:00
Daniel Hofstetter
e2634e5c48
Merge pull request #8567 from sylvestre/rm-progress
rm: add the --progress option like with cp & mv
2025-10-22 11:14:14 +02:00
Sylvestre Ledru
94e10238c5
Merge pull request #8513 from aaron-ang/migrate-manpage
uudoc: move manpage and completions generation out of binary
2025-10-22 11:02:12 +02:00
Aaron Ang
2919027841 uudoc: move manpage generation away from the binary 2025-10-22 01:17:08 -07:00
Sylvestre Ledru
8bf15fe676 rm: add the --progress option like with cp & mv 2025-10-22 00:27:49 +02:00
Sylvestre Ledru
2434c2ae13 Install: implement -Z
Fixes: tests/install/install-Z-selinux
2025-10-21 23:27:06 +02:00
Christopher Armstrong
1c0214b29d du: ignore env zero blocksize 2025-10-20 07:26:32 -04:00
Daniel Hofstetter
14ba196a79 Cargo.toml: remove "test_unimplemented" feature 2025-10-19 11:41:14 +02:00
naoNao89
16b386537f chore: silence cspell for timezone abbreviations (AWST, ACST, ACDT, Kolkata, tzdb) 2025-10-18 03:49:11 +07:00
naoNao89
49c3386d19 fix(date): add timezone abbreviation support for date --set
Fixes #1882

Implements dynamic timezone abbreviation resolution with minimal hardcoding:
- Dynamically discovers 588+ IANA timezones and their abbreviations
- Only 11 hardcoded disambiguations for truly ambiguous cases (CST, EST, IST, etc.)
- US timezone preferences for GNU compatibility
- Comprehensive test coverage including Australian, Asian, European, and US timezones

All date --set formats now work correctly.
2025-10-18 03:13:42 +07:00
Zackary Ayoun
3ff51d6402 ls: fix zero block size handling to match GNU ls
- Reject --block-size=0 with "invalid --block-size argument '0'" error
  using parse_size_non_zero_u64
- Add test coverage for both command-line and env var cases

Matches GNU ls behavior where command-line zero is invalid but
environment variable zero is silently ignored.
2025-10-17 16:18:48 +00:00
Sylvestre Ledru
db9c50c327
Merge pull request #8941 from cakebaker/od_small_refactorings
od: fix incomplete test & apply small refactorings to tests
2025-10-17 17:07:56 +02:00
Daniel Hofstetter
56aad28b0e od: apply small refactorings to tests 2025-10-17 16:33:49 +02:00
Daniel Hofstetter
1263ba20be
Merge pull request #8932 from Ada-Armstrong/df_env_var_zero_block_size
df: treat env var with zero block size same as invalid
2025-10-17 16:16:48 +02:00
Daniel Hofstetter
20775fd6a9 od: fix incomplete test 2025-10-17 15:48:59 +02:00
Christopher Armstrong
6015c8fa31 df: treat env var with zero block size as invalid 2025-10-17 09:32:37 -04:00
Daniel Hofstetter
0258583aac
Merge pull request #8849 from sylvestre/od-n
od: add support for -S
2025-10-17 10:03:28 +02:00
Sylvestre Ledru
b1afe3499a fix tests/od/od-N 2025-10-16 06:13:45 -04:00
alexander
6e422b728e
df: add tracing zero and rounding (#8685)
Some checks failed
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
CICD / Build/SELinux-Stubs (Non-Linux) (push) Blocked by required conditions
CICD / Safe Traversal Security Check (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Benchmarks / Run benchmarks (CodSpeed) (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Has been cancelled
2025-10-15 22:11:44 -04:00
alexander
517b5fb8b3
hostname: fix -d flag (#8657)
* hostname: fix -d flag

* tests/hostname: test -d when no domain
2025-10-15 22:07:54 -04:00
Cả thế giới là Rust
af766713c5
test(nohup): improve coverage for fd replacement and error paths (#8920)
* test(nohup): expand test coverage for fd replacement and error paths

Add comprehensive tests for nohup's file descriptor replacement logic
and error handling, increasing coverage of previously untested code paths.

New tests cover:
- Creating nohup.out in current directory
- Appending to existing nohup.out
- Stderr redirection to stdout
- Command not found error (exit codes 126/127)
- Fallback to $HOME/nohup.out when cwd is not writable (Linux/FreeBSD)
- POSIXLY_CORRECT environment variable handling (Linux/FreeBSD)

Tests use .terminal_simulation(true) to properly test TTY-dependent
behavior. Platform-specific tests are gated behind appropriate cfg
attributes.

Addresses #1857

* fix: CI failures for cspell and clippy in nohup tests

- Add 'nowrite' to cspell jargon dictionary
- Fix clippy::uninlined_format_args warnings in test_nohup.rs
- Remove nested #[test] function that caused unnameable-test-items error
- Format strings now use inline variable syntax
2025-10-15 21:39:19 -04:00
Cả thế giới là Rust
88bc1c5fc3
Merge pull request #8911 from naoNao89/fix-dirname-trailing-dot
Fix dirname handling of paths ending in `/.`
2025-10-15 20:19:14 -04:00
Christopher Armstrong
37d00ae89b cp: display symlink creation with --verbose
cp: display removed files with --verbose
2025-10-15 22:30:27 +01:00
Sylvestre Ledru
e2e5c76a7c
Merge pull request #8907 from naoNao89/fix/date-numeric-d-parsing
Some checks failed
CICD / MinRustV (push) Has been cancelled
CICD / Separate Builds (push) Has been cancelled
CICD / Dependencies (push) Has been cancelled
CICD / Code Coverage (push) Has been cancelled
Android / Test builds (push) Has been cancelled
GnuTests / Run GNU tests (native) (push) Has been cancelled
GnuTests / Run GNU tests (SELinux) (push) Has been cancelled
Benchmarks / Run benchmarks (CodSpeed) (push) Has been cancelled
Code Quality / Style/format (push) Has been cancelled
Code Quality / Style/lint (push) Has been cancelled
Code Quality / Style/spelling (push) Has been cancelled
Code Quality / Style/toml (push) Has been cancelled
Code Quality / Style/Python (push) Has been cancelled
Code Quality / Pre-commit hooks (push) Has been cancelled
Devcontainer / Verify devcontainer (push) Has been cancelled
FreeBSD / Style and Lint (push) Has been cancelled
FreeBSD / Tests (push) Has been cancelled
WSL2 / Test (push) Has been cancelled
CICD / Binary sizes (push) Has been cancelled
CICD / Build (push) Has been cancelled
CICD / Test all features separately (push) Has been cancelled
CICD / Build/Makefile (push) Has been cancelled
CICD / Build/stable (push) Has been cancelled
CICD / Build/nightly (push) Has been cancelled
CICD / Tests/BusyBox test suite (push) Has been cancelled
CICD / Tests/Toybox test suite (push) Has been cancelled
CICD / Safe Traversal Security Check (push) Has been cancelled
CICD / Build/SELinux (push) Has been cancelled
CICD / Build/SELinux-Stubs (Non-Linux) (push) Has been cancelled
GnuTests / Aggregate GNU test results (push) Has been cancelled
date: follow GNU pure-number -d semantics
2025-10-14 12:29:29 +02:00
Daniel Hofstetter
58f32648d7
Merge pull request #8900 from Alonely0/clippy
chore: huge clippy pass ahead of 1.92.0 release
2025-10-14 10:45:47 +02:00