5034 Commits

Author SHA1 Message Date
Daniel Hofstetter e88edb4b1a truncate: remove duplicate test 2026-06-10 17:17:11 +02:00
Sylvestre Ledru 82ff02156e fold: continue processing files after an open error (#12668)
Should make test fold/multiple-files.sh pass
2026-06-10 07:50:38 +02:00
Wei Li f24a8ced07 install: don't panic when the strip program is killed by a signal (#12730)
`install -s --strip-program=PROG` aborted with an Option::unwrap panic when
PROG was terminated by a signal: the strip-failure branch formatted its error
with `status.code().unwrap()`, but `ExitStatus::code()` is `None` for a
signal-terminated process.

Branch on `status.code()`: keep the existing "exit code: N" message for a
normal non-zero exit, and use a new `install-error-strip-terminated` message
("strip process terminated abnormally") for the signal case — matching GNU,
which reports the same and exits 1. Adds the locale key to en-US and fr-FR and
a regression test.
2026-06-09 22:17:37 +02:00
Wei Li 3db0433c41 dircolors: don't panic on an invalid TERM/COLORTERM glob (#12728)
A database file with a TERM/COLORTERM line whose value is an invalid glob
(e.g. an unclosed `[`) aborted dircolors with a Result::unwrap panic:
`fnmatch` did `parse_glob::from_str(pat).unwrap().matches(self)`, and
from_str returns Err for an unparseable pattern.

Use `is_ok_and`, so an invalid glob is treated as a non-match (and the
unmatched TERM section is skipped) instead of crashing — matching GNU, which
emits an empty LS_COLORS and exits 0.
2026-06-09 22:16:55 +02:00
Devel 47f549a8fa gnucompability(fold): uutils fold accept width 0 but gnu fold rejects it (#12744) 2026-06-09 22:12:54 +02:00
Sylvestre Ledru d21d02e6ab truncate: process all files when one fails
Should make test truncate/multiple-files.sh pass
2026-06-09 16:01:47 +02:00
Sylvestre Ledru 47dcbbaa15 rm: rewrite dash-hint test with original fixtures 2026-06-09 15:19:32 +02:00
Sylvestre Ledru dab93926d2 rm: hint to use ./-foo when removing a dash-prefixed file 2026-06-08 22:06:42 +02:00
Juan Cruz Mateos 80cc829771 sort: fix locale collation strength for hyphen ordering (#12677)
Set Strength::Quaternary on the ICU collator so that punctuation like
hyphens sort before alphanumerics in UTF-8 locales, matching GNU sort
behavior.

Fixes #12542
2026-06-07 21:55:03 +02:00
Sylvestre Ledru b2ddbabed3 fold: insert fold newline at read-buffer boundary (#12682)
follow up of #11314
2026-06-07 21:41:59 +02:00
Sylvestre Ledru 89980ad700 ignore a ln wasm test 2026-06-07 14:36:17 +02:00
Wondr 1cda36fbed split: reject excessive suffix lengths (#12609) 2026-06-07 11:45:15 +02:00
Zhang Wen db86d3d668 fix install file with invalid uid (#7789)
* treat invalid user or group as uid or gid if it's an integer

* install: add test for install with invalid user or group
2026-06-07 11:27:36 +02:00
Himadri Bhattacharjee e6a6cb6399 fold: fix crash when reading from pseudo-devices (#11314)
* fold: fix crash when reading from pseudo-devices

squashme: wraparound struct for fold
squashme: fix crash when reading from pseudo-devices
Fixes #11291

* tests/fold: add tests to read from pseudo device streams

* tests/fold: kill child process before making asserts

* tests/fold: test fold on pseudo devices only for bsds and linux
2026-06-07 11:25:52 +02:00
Can Bölük 48d030dfb2 ln: accept non-utf8 source names in target-dir modes (#11403)
* ln: accept non-utf8 source names in target-dir modes

* ln: remove unused ln-error-cannot-stat locale strings
2026-06-06 19:40:42 +02:00
Puneet Dixit b15dba29c4 date: reject excessive format widths (#12497)
* date: reject excessive format widths

* date: relax huge width diagnostic test

* date: cap format modifier widths

---------

Co-authored-by: Deepak kudi <deepakkudi23@Deepaks-MacBook-Air.local>
Co-authored-by: Deepak kudi <deepakkudi23@adsl-172-10-9-116.dsl.sndg02.sbcglobal.net>
Co-authored-by: Puneet Dixit <puneetdixit200@users.noreply.github.com>
2026-06-06 08:49:11 +02:00
Sylvestre Ledru 7d27b3baa1 head: add TOCTOU regression tests and fix comment typo (#12637)
Follow-up to the metadata TOCTOU fix (#11972, PR #12439):

- Add a syscall-level regression guard in util/check-safe-traversal.sh:
  under strace, head must read metadata from the open descriptor
  (fstat/statx on the fd) and must not stat the path before opening it.
  Verified this fails on the pre-fix code and passes after.
- Add an integration test asserting that an unreadable file produces an
  error but no "==> name <==" header, matching GNU (the header is only
  printed after a successful open).
- Fix a stray paren in the Windows-branch comment.
2026-06-05 15:21:40 +02:00
mattsu 533edad992 kill: replace nix::sys::signal with rustix::process (#12326) 2026-06-05 13:09:15 +02:00
weili abcdcdca53 pr: reject a non-positive expand-tab width (-e0)
`pr -e0` on input containing a tab aborted with a remainder-by-zero panic
(`chunk.len() % expand_options.width` in `apply_expand_tab`). The
`-e[char][width]` parser accepted a width of `0` — and a negative width via
e.g. `-eX-5` — without validation, so the zero/negative reached the chunk
arithmetic.

Reject `width <= 0` while parsing `-e`, emitting the same invalid-argument
error GNU produces (`pr: '-e' extra characters or invalid number in the
argument: '0'`, exit 1) instead of crashing.
2026-06-05 11:19:08 +02:00
Sylvestre Ledru 6d015356dd pwd: ignore non-option arguments, drop getcwd disabling from pwd-long test 2026-06-05 09:44:04 +02:00
Devel bd9f32f7ae numfmt: prevent panic if float precision specifier > 65535 (#12600) 2026-06-04 17:03:36 +02:00
Sylvestre Ledru ca0c842e71 touch: drop O_TRUNC on create to close TOCTOU race (#10019) 2026-06-04 16:19:26 +02:00
Lorenzo Rossi cfc6457681 chown: restrict no-dereference symlink ctime test to Linux (#12556) 2026-06-03 17:40:14 +02:00
Daniel Hofstetter f1073d7c9e dircolors: turn integration test into unit test 2026-06-02 11:38:32 +02:00
Nikola Lukovic 3fbcb79a30 chmod/chown: symlink cycles detection (#11805) 2026-06-01 15:13:58 +02:00