Commit Graph

4987 Commits

Author SHA1 Message Date
xtqqczze 7449705a98 fix(tests): refine feature checks for SELinux 2026-05-19 11:19:55 +02:00
xtqqczze fb8e4b1612 fix: correct feature flag name for SELinux context test 2026-05-19 11:19:55 +02:00
oech3 7cd4bbeee2 tests_tail.rs: remove nix 2026-05-19 10:33:29 +02:00
oech3 1db0a453eb tests_sort.rs: remove nix 2026-05-19 10:20:53 +02:00
oech3 a9cf501870 tests_ls.rs: remove nix 2026-05-19 08:59:12 +02:00
Sylvestre Ledru 515d74b995 mv: atomically replace existing dest when moving symlinks cross-device (#10010)
EXDEV fallback now catches AlreadyExists and replaces the destination
via temp-name + fs::rename. Matches GNU mv.
2026-05-17 13:03:17 +02:00
Cả thế giới là Rust 34e71a6208 test(tail): fix flaky test_follow_name_multiple on macOS (#9636)
Increase timeout from 500ms to 1300ms on macOS to account for file system
caching delays when reading redirected output from temp files.
2026-05-16 23:08:53 +02:00
Daniel Hofstetter f1e051b8d8 nl: continue if a file can't be opened (#11983) 2026-05-16 22:20:02 +02:00
oech3 e408b5ac88 uucore::pipes: merge pipe_with_size to pipe and catch fcntl err (#12285) 2026-05-16 22:19:01 +02:00
oech3 ab328d170e coreutils: fix panic on linux < 6.4 when /proc is not mounted (#12104) 2026-05-16 22:12:43 +02:00
0xSoftBoi dfd62976de date: re-zone trailing TZ abbreviation input to local timezone (#12327)
The dedicated abbreviation-aware path `try_parse_with_abbreviation` in
`src/uu/date/src/date.rs` returned a `Zoned` in the input abbreviation
timezone (e.g. `-05` for `EST`). The generic `parse_datetime` fallback
already re-zones to `now.time_zone()` for display, so identical inputs
took two divergent code paths and only one matched GNU `date`.

GNU treats a trailing TZ abbreviation as describing the *input*
timezone; the output is always re-zoned into the local zone (or UTC
under `-u`). For example, under `TZ=UTC`:

    $ date -d "2024-01-01 EST"        # GNU
    Mon Jan  1 05:00:00 UTC 2024

uutils previously emitted `Mon Jan  1 00:00:00 -05 2024`.

Convert the parsed instant to `now.time_zone()` before returning,
matching the fallback path and GNU’s behavior. `-u` still works
because `now` is already zoned to UTC in that case (date.rs:362),
and the final output stage still applies `with_time_zone(TimeZone::UTC)`
when `settings.utc` is set.

Un-ignores the existing regression test for this issue.

Fixes uutils/parse_datetime#281.
2026-05-16 22:01:37 +02:00
oech3 0c21cb9c29 tr: replace nix by rustix (#12266) 2026-05-13 07:53:46 +02:00
xtqqczze f4a0bb3bcd more: replace nix::unistd with std::fs (#12268) 2026-05-13 07:44:26 +02:00
oech3 eca185b22b replace nix getgroups by rustix (#12269) 2026-05-13 07:41:32 +02:00
Sylvestre Ledru 28cff684bd head: fix -c0 and -n0 on directories to match GNU behavior
When zero bytes or zero lines are requested, there is nothing to read,
so we should not check whether the path is a directory. GNU head
succeeds in this case because it never attempts to open/read the file.

Previously, uutils head would stat the file and reject directories
even when no reading was needed, causing a spurious 'Is a directory'
error.

Fixes #12215
2026-05-12 14:49:42 +02:00
Sylvestre Ledru f057cc6a01 tests: replace .no_stdout().no_stderr() chains with .no_output()
Bulk rename of the antipattern across 19 test files (136 occurrences).
.no_output() is the established shorthand in the uutests framework
for asserting both empty stdout and empty stderr.
2026-05-12 09:31:31 +02:00
oech3 def380d7c7 uutests: remove 1 unsafe 2026-05-11 08:29:09 +02:00
oech3 2036729164 test_chmod.rs: remove unsafe 2026-05-10 11:34:39 +02:00
oech3 055a66b78e cat: remove line buffering 2026-05-08 09:49:38 +02:00
Max Ambaum 912471d40a od: hex byte offset case fix (#12175)
* Made hex byte offset lowercase

* Added test based on issue

* Fixed formatting, moved import to local scope

* Fixed failing tests

* Forced no wasi test

* Revert "Forced no wasi test"

This reverts commit 0cd71c69bf.

* Switched linux to unix, to match test_dd

* Removed urandom dependency credit @cakebaker
2026-05-07 17:28:46 +02:00
Daniel Hofstetter 10e3a9c3b8 tests,stdbuf: adapt to change in ctor 2026-05-07 09:44:53 +02:00
Daniel Hofstetter bf75238336 md5sum: remove some stderr_is("") in the tests 2026-05-06 18:07:20 +02:00
oech3 37c42a29ca id: replace nix by rustix 2026-05-06 17:52:38 +02:00
Dorian Péron f665b63cc4 cksum: Fix --check filename escaping for 9.11 2026-05-06 17:21:34 +02:00
Sylvestre Ledru bd170a5d4b cp: strip setuid/setgid when chown fails during -p (#9750)
When `cp -p` cannot chown the destination to the source's owner
(e.g. a non-root user copying a root-owned setuid file), GNU cp
strips the setuid and setgid bits from the applied mode so the
destination does not give the copying user elevated privileges via
the copy. uutils was unconditionally applying the source mode,
producing user-owned files with a live setuid bit.

Track `ownership_preserved` alongside the existing chown retry
logic and, in the subsequent `handle_preserve(mode, ...)` block,
mask off `0o6000` from the source's mode when ownership could not
be preserved. The sticky bit (01000) is kept, matching GNU.
2026-05-06 11:47:38 +02:00