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.
Fixesuutils/parse_datetime#281.
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
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.
* 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
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.