Commit Graph
5018 Commits
Author SHA1 Message Date
John ChittumandSylvestre Ledru 8296884cf5 mkdir: acl and permission inheritance with -p
Workflow for permission setting and ACLs failed in several scenarios,
most notable when passing -p. Parent directories in the mkdir call would
not appropriately set ACLs and could end up with more open permissions.
Generally, there was a misunderstanding that GNU coreutils was setting
umask (0) and that was the default -- the real flow was using a shaped
umask that takes current umask and ensures that the user has the ability
to execute mkdir commands through the tree. The umask (0) call was part
of a read setup for the equivalent of our UmaskGuard. New workflow
focuses on safe defaults, shaped umask, and allowing the Kernel to do
to apply ACLs. Adds a test specifically to guard against regression,
ensuring a more restrictive ACL is respected with mkdir -p
2026-05-24 18:36:28 +02:00
xtqqczzeandDaniel Hofstetter 24e3d0d39e fix(selinux): add missing os checks 2026-05-21 09:13:41 +02:00
oech3andSylvestre Ledru a2d29c0216 dd: fix OOM panic with skip=1 2026-05-20 17:14:07 +02:00
wuyangfanandDaniel Hofstetter 43c1e7b111 fix(sort): reject leading '+' in numeric (-n) sort
GNU sort -n does not treat '+' as a number sign. Skip f64 parsing for
lines with a leading plus so they sort lexicographically like GNU.

Fixes #10315
2026-05-20 11:52:38 +02:00
Eyüp Can AkmanandGitHub 5807760aa2 du: honor LC_NUMERIC for decimal separator (#12357)
* du: honor LC_NUMERIC for decimal separator

Route the fractional digit in `uucore::format::human::format_prefixed`
through `locale_decimal_separator()`, the same helper #11941 added for
`numfmt`. Fixes #11956.

* du: spell-check: ignore `replacen`

Matches the directive in `src/uu/numfmt/src/format.rs` for the same
helper introduced by #11941.
2026-05-20 10:38:12 +02:00
xtqqczzeandDaniel Hofstetter 57135cb9bd refactor: replace rustix::pipe with std::io::pipe 2026-05-19 16:11:49 +02:00
xtqqczzeandDaniel Hofstetter 7449705a98 fix(tests): refine feature checks for SELinux 2026-05-19 11:19:55 +02:00
xtqqczzeandDaniel Hofstetter fb8e4b1612 fix: correct feature flag name for SELinux context test 2026-05-19 11:19:55 +02:00
oech3andDaniel Hofstetter 7cd4bbeee2 tests_tail.rs: remove nix 2026-05-19 10:33:29 +02:00
oech3andDaniel Hofstetter 1db0a453eb tests_sort.rs: remove nix 2026-05-19 10:20:53 +02:00
oech3andDaniel Hofstetter 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à RustandGitHub 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 HofstetterandGitHub f1e051b8d8 nl: continue if a file can't be opened (#11983) 2026-05-16 22:20:02 +02:00
oech3andGitHub e408b5ac88 uucore::pipes: merge pipe_with_size to pipe and catch fcntl err (#12285) 2026-05-16 22:19:01 +02:00
oech3andGitHub ab328d170e coreutils: fix panic on linux < 6.4 when /proc is not mounted (#12104) 2026-05-16 22:12:43 +02:00
0xSoftBoiandGitHub 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
oech3andGitHub 0c21cb9c29 tr: replace nix by rustix (#12266) 2026-05-13 07:53:46 +02:00
xtqqczzeandGitHub f4a0bb3bcd more: replace nix::unistd with std::fs (#12268) 2026-05-13 07:44:26 +02:00
oech3andGitHub eca185b22b replace nix getgroups by rustix (#12269) 2026-05-13 07:41:32 +02:00
Sylvestre LedruandDaniel Hofstetter 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 LedruandDaniel Hofstetter 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
oech3andDaniel Hofstetter def380d7c7 uutests: remove 1 unsafe 2026-05-11 08:29:09 +02:00
oech3andDaniel Hofstetter 2036729164 test_chmod.rs: remove unsafe 2026-05-10 11:34:39 +02:00
oech3andDaniel Hofstetter 055a66b78e cat: remove line buffering 2026-05-08 09:49:38 +02:00