Commit graph

4472 commits

Author SHA1 Message Date
AnarchistHoneybun
78b5b5ff9e tests: use at_and_ucmd macro and remove redundant cfg guards 2025-12-23 08:50:08 +05:30
nirv
afedc0774c
Merge branch 'main' into bug/cp-preserve-xattr-9704 2025-12-23 08:45:54 +05:30
Christopher Dryden
0fbc17c2dd clap_localization: return error instead of calling exit() for fuzzer compatibility 2025-12-22 14:14:09 +01:00
Sylvestre Ledru
6df86206a8 date: handle unknown options gracefully 2025-12-22 14:14:09 +01:00
Sylvestre Ledru
055ba74126 date: allow extra operand 2025-12-22 14:14:09 +01:00
Sylvestre Ledru
58266a890a date: handle the empty arguments 2025-12-22 14:14:09 +01:00
Dorian Péron
0bfbbc00c7
Fix printenv non-UTF8 (#9728)
* printenv: Handle invalid UTF-8 encoding in variables

* test(printenv): Add test for non-UTF8 content in variable
2025-12-22 14:12:38 +01:00
Daniel Hofstetter
87ba3afd19
Merge pull request #9317 from sylvestre/shred-passes
shred: ensure deterministic pass sequence compatibility with reference implementation
2025-12-22 11:14:39 +01:00
oech3
2b67abe741
hashsum: Drop --no-names (#9762)
Co-authored-by: oech3 <>
2025-12-22 10:17:28 +01:00
Kornél Csernai
eed7a0aca7
parser: add binary support to determine_number_system and parse_size (#9659)
* parser: add binary support to determine_number_system and parse_size

* docs

* tests

* tests: threshold
2025-12-22 09:24:44 +01:00
Daniel Hofstetter
79f09a62f0
Merge pull request #9695 from RenjiSann/checksum-ignore-binary
Some checks are pending
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/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
Check uudoc Documentation Generation / Verify uudoc generates correct documentation (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
OpenBSD / Style and Lint (push) Waiting to run
OpenBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
Checksum ignore binary
2025-12-21 16:14:24 +01:00
Mahdi Ali-Raihan
7da2a2dd8b
cat: do not connect to unix domain socket and instead return an error (#9755)
* cat: do not connect to unix domain socket and instead return an error. fixed #9751

* added empty line to fr-FR.ftl

* made NoSuchDeviceOrAddress error unix specific
2025-12-21 14:54:38 +01:00
nirv
f7969d7f82
Merge branch 'main' into bug/cp-preserve-xattr-9704 2025-12-21 15:13:48 +05:30
RustyJack
939ab037a2
uucore: use --suffix to enable backup mode (#9741) 2025-12-21 10:17:35 +01:00
nirv
92b4ec2b67
Merge branch 'main' into bug/cp-preserve-xattr-9704 2025-12-21 10:26:37 +05:30
David
1fca82965d
dd: should terminate with error if skip argument is too large (#7275)
Some checks failed
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/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
OpenBSD / Style and Lint (push) Waiting to run
OpenBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
CheckScripts / ShellScript/Check (push) Has been cancelled
CheckScripts / ShellScript/Format (push) Has been cancelled
fixed clippy warning
2025-12-20 19:04:12 +01:00
Dorian Peron
34c41dfc6b checksum: drop "text" checksum computation on windows 2025-12-20 15:38:04 +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
nirv
b0d6c49630
Merge branch 'main' into bug/cp-preserve-xattr-9704 2025-12-20 09:27:22 +05:30
Christopher Dryden
5d4abd88e9 env: preserve non-UTF-8 environment variables 2025-12-19 16:09:57 -05:00
Cả thế giới là Rust
16f73503b3
feat(date): add locale-aware hour format detection (#9654)
Implement locale-aware 12-hour vs 24-hour time formatting that respects
LC_TIME environment variable preferences, matching GNU coreutils 9.9 behavior.

- Add locale.rs module with nl_langinfo() FFI for POSIX locale queries
- Detect locale hour format preference (12-hour vs 24-hour)
- Use OnceLock caching for performance (99% faster on repeated calls)
- Update default format to use locale-aware formatting
- Add integration tests for C and en_US locales

Fixes compatibility with GNU coreutils date-locale-hour.sh test.
2025-12-19 17:05:31 +01:00
nirv
655cf52aac
Merge branch 'main' into bug/cp-preserve-xattr-9704 2025-12-19 15:40:07 +05:30
Daniel Hofstetter
2d3aebce67
Merge pull request #9700 from sylvestre/issue-9699
kill -1 should trigger an error
2025-12-19 09:32:07 +01:00
nirv
64478acdbf
date: fix inconsistent input parsing between -s and -d flags (#9690)
Add allow_hyphen_values(true) to -s flag to accept hyphen-prefixed values like '-3 days', making it consistent with -d flag behavior and GNU coreutils compatibility.

Fixes #9679
2025-12-19 08:48:08 +01:00
Daniel Hofstetter
15d51c8804
Merge pull request #9693 from sylvestre/printf
printf: Format String Parsing Overflow Causes Panic
2025-12-19 08:33:58 +01:00
AnarchistHoneybun
68522d95fd cp: fix -p to not preserve xattrs by default
Fixes #9704

The -p flag should only preserve mode, ownership, and timestamps,
matching GNU cp behavior. Extended attributes require explicit
--preserve=xattr or -a (archive mode).

Changed Attributes::DEFAULT to set xattr preservation to No,
preventing unintended security risks and filesystem compatibility
issues.

Adds regression test.
2025-12-19 09:39:54 +05:30
Sylvestre Ledru
cae94028af kill -1 should trigger an error
https://github.com/uutils/coreutils/issues/9699
2025-12-18 21:49:09 +01:00
Sylvestre Ledru
0b63ffca5c printf: Format String Parsing Overflow Causes Panic
Closes: https://github.com/uutils/coreutils/issues/9697
2025-12-18 18:30:21 +01:00
Chris Dryden
b4b08e9596
nohup: use POSIXLY_CORRECT to determine failure exit code (#9685)
* nohup: use POSIXLY_CORRECT to determine failure exit code

* Update env value checking

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

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-12-18 18:29:55 +01:00
xtqqczze
c9268934c0 clippy: fix borrow_as_ptr lint
https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
2025-12-18 00:19:14 +00:00
Daniel Hofstetter
6b23e6f321
Merge pull request #9673 from ChrisDryden/fix-nl-preserve-bytes
nl: preserve raw bytes in output instead of using from_utf8_lossy
2025-12-16 15:22:29 +01:00
Christopher Dryden
93c8d5439b nl: preserve raw bytes in output instead of using from_utf8_lossy 2025-12-16 13:04:18 +00:00
karanabe
06d843fe19
Add legacy +POS/-POS handling in sort to pass GNU sort-field-limit test (#9501)
Some checks are pending
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
OpenBSD / Style and Lint (push) Waiting to run
OpenBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
* sort: add legacy +POS/-POS parsing for GNU compat

Support GNU’s obsolescent +POS1 [-POS2] syntax by translating it to -k
before clap parses args, gated by _POSIX2_VERSION. Adds tests for accept
and reject cases to ensure sort-field-limit GNU test passes.

* sort: align legacy key tests with GNU field limit

* sort: rename legacy max-field test for clarity

* Simplify legacy key parsing inputs

* Inline legacy key end serialization

* Use starts_with for legacy arg digit check
2025-12-15 09:59:56 +01:00
oech3
5c2b8dc065
util.rs: Update obsolete comments 2025-12-12 20:05:11 +09:00
Chris Dryden
a7e4e91fb1
base32, base64, basenc: Simplifying the base encoding uu_app and adding basic buffer tests (#9409)
Some checks are pending
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
OpenBSD / Style and Lint (push) Waiting to run
OpenBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
* Simplifying the base encoding uu_app and adding basic buffer tests

* Added an ignore for the spell checker on base encoding output
2025-12-12 09:43:38 +01:00
mattsu
6ec43a69ce chore(tests): update spell-checker ignore list in test_readlink.rs
Add 'parentdir' to the ignored words to suppress spell-checker warnings, as it's used in test scenarios and not a misspelled term.
2025-12-11 20:19:24 +09:00
mattsu
04a6737e5d fix(readlink): use physical resolution for canonicalize flags to match GNU behavior
Changed ResolveMode from Logical to Physical for -f, -e, and -m flags in readlink to ensure symlinks are followed before resolving '..' (parent directory), matching GNU readlink's physical resolution order for compatibility. Added a test case to verify the symlink resolution occurs before parent directory evaluation.
2025-12-11 19:02:11 +09:00
Cả thế giới là Rust
415d01cc75
cp: add readonly file regression tests (#9045)
Some checks are pending
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
OpenBSD / Style and Lint (push) Waiting to run
OpenBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
* feat: add comprehensive readonly file regression tests for cp

- Add 10 new test functions covering readonly destination behavior
- Tests cover basic readonly copying, flag combinations, and edge cases
- Include macOS-specific clonefile behavior tests
- Ensure readonly file protection from PR #5261 cannot regress
- Tests provide evidence for closing issue #5349

* perf: optimize readonly regression tests with batched I/O operations

- Reduce file I/O overhead by batching file operations
- Consolidate setup operations to minimize system calls
- Improve test execution time from 0.44s to 0.27s (38% improvement)
- Maintain comprehensive test coverage for readonly file behavior

* fix: remove duplicate tests and trivial comments per PR feedback

- Remove test_cp_readonly_dest_regression (duplicate of test_cp_dest_no_permissions)
- Remove test_cp_readonly_dest_with_force (duplicate of test_cp_arg_force)
- Remove test_cp_readonly_dest_with_remove_destination (duplicate of test_cp_arg_remove_destination)
- Remove test_cp_macos_clonefile_readonly (duplicate of test_cp_existing_target)
- Remove test_cp_normal_copy_still_works (duplicate of test_cp_existing_target)
- Remove trivial performance comments from readonly tests
- Keep existing proven tests per maintainer preferences
- Keep unique readonly tests that provide additional coverage
2025-12-10 14:54:17 +01:00
Chris Dryden
1ffad8228a
cp: Enabling cp force flag to run on windows (#9624)
* Enabling cp force flag to run on windows

* Windows requires clearing the readonly permissions before deleting
2025-12-10 09:22:04 +01:00
Christopher Dryden
bca0aa08f7 Adding test to cover no dereference when copying symlinks 2025-12-10 04:17:17 +00:00
Daniel Hofstetter
aaa061052f
Merge pull request #9569 from RenjiSann/cksum-fix-b2sum
Some checks are pending
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 / 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
CICD / Code Coverage (push) Waiting to run
CICD / Test all features separately (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/Python (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
FreeBSD / Tests (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
FreeBSD / Style and Lint (push) Waiting to run
OpenBSD / Style and Lint (push) Waiting to run
OpenBSD / Tests (push) Waiting to run
WSL2 / Test (push) Waiting to run
hashsum: Fix length processing to fix last GNU test
2025-12-08 14:29:38 +01:00
Dorian Peron
00d90700ca test(hashsum): Improve tests for checking length validation errors for BLAKE2b 2025-12-08 13:10:37 +01:00
Shay Elkin
a7c9d03ea3
Merge pull request #9152 from shayelkin/main
uudoc: fix manpage for individual utilities has wrong name (nit)
2025-12-07 17:07:19 +01:00
Daniel Hofstetter
eda7caec73
Merge pull request #9588 from oech3/patch-6
coreutils: Print utility not found to stderr
2025-12-07 13:29:36 +01:00
Mahdi Ali-Raihan
345f2ccd14
tests/mkfifo: added a test to check mkfifo permission denied error for code coverage (#9586)
* tests/mkfifo: added a test to check mkfifo permission denied error for code coverage

* fixed formatting
2025-12-07 13:05:45 +01:00
oech3
28576decc1 coreutils: Print utility not found to stderr 2025-12-07 18:02:20 +09:00
Sylvestre Ledru
7c62885c84
Merge pull request #9578 from martinkunkel2/mknod-multiple-modes
Some checks are pending
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox 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 / Dependencies (push) Waiting to run
CICD / Build/nightly (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
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 (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/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
OpenBSD / Tests (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
OpenBSD / Style and Lint (push) Waiting to run
WSL2 / Test (push) Waiting to run
uucore: mode parsing: support comma-separated modes
2025-12-06 17:01:35 +01:00
Martin Kunkel
63dbffa7f3 Add tests for multiple mode specifications 2025-12-06 15:08:13 +00:00
Daniel Hofstetter
499f056972
Merge pull request #9573 from sylvestre/ptx
ptx: implement GNU mode with dumb terminal format
2025-12-06 15:19:36 +01:00
Daniel Hofstetter
a0c14aacbb
Merge pull request #9580 from Ecordonnier/eco/remove-fixme
timeout: remove FIXME in test
2025-12-06 14:48:02 +01:00