Commit Graph
4424 Commits
Author SHA1 Message Date
Sylvestre Ledru dab93926d2 rm: hint to use ./-foo when removing a dash-prefixed file 2026-06-08 22:06:42 +02:00
Juan Cruz MateosandGitHub 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 LedruandGitHub b2ddbabed3 fold: insert fold newline at read-buffer boundary (#12682)
follow up of #11314
2026-06-07 21:41:59 +02:00
Sylvestre LedruandDaniel Hofstetter 89980ad700 ignore a ln wasm test 2026-06-07 14:36:17 +02:00
WondrandGitHub 1cda36fbed split: reject excessive suffix lengths (#12609) 2026-06-07 11:45:15 +02:00
Zhang WenandGitHub 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 BhattacharjeeandGitHub 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ükandGitHub 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
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 LedruandGitHub 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
mattsuandGitHub 533edad992 kill: replace nix::sys::signal with rustix::process (#12326) 2026-06-05 13:09:15 +02:00
weiliandDaniel Hofstetter 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 LedruandDaniel Hofstetter 6d015356dd pwd: ignore non-option arguments, drop getcwd disabling from pwd-long test 2026-06-05 09:44:04 +02:00
DevelandGitHub bd9f32f7ae numfmt: prevent panic if float precision specifier > 65535 (#12600) 2026-06-04 17:03:36 +02:00
Sylvestre LedruandDorian Péron ca0c842e71 touch: drop O_TRUNC on create to close TOCTOU race (#10019) 2026-06-04 16:19:26 +02:00
Lorenzo RossiandGitHub cfc6457681 chown: restrict no-dereference symlink ctime test to Linux (#12556) 2026-06-03 17:40:14 +02:00
Daniel HofstetterandSylvestre Ledru f1073d7c9e dircolors: turn integration test into unit test 2026-06-02 11:38:32 +02:00
Nikola LukovicandGitHub 3fbcb79a30 chmod/chown: symlink cycles detection (#11805) 2026-06-01 15:13:58 +02:00
oech3andDaniel Hofstetter 10ef28ddc1 pipes:rs: replace unnecessary splice by read-ahead hint 2026-06-01 13:33:27 +02:00
Wei LiandGitHub bcdd134352 shuf: fix panic/abort on large -i range without small --head-count (#12501)
* shuf: fix panic/abort on large -i range without small --head-count

NonrepeatingIterator::new sized its sparse hash map to
min(head_count, range_len) and allocated it with the infallible
with_capacity_and_hasher. head_count defaults to u64::MAX when -n is
absent (and can be passed a huge value explicitly), so for a large -i
range the map was asked to reserve the whole range:

  shuf -i 1-9999999999999999999                       # no -n
  shuf -i 1-9999999999999999999 -n 9999999999999999999

Both aborted (exit 134) with a hashbrown "Hash table capacity overflow"
panic or an allocator abort, where GNU prints "memory exhausted" and
exits 1.

Reserve fallibly with try_reserve (mirroring the Vec branch) and map
the failure to a clean error, so an unsatisfiable request errors like
GNU instead of crashing. A small --head-count still works unchanged.

Closes #12500.

* shuf: assert full stderr (incl. program prefix) in memory-exhausted tests

Per review on #12501: switch the two memory-exhausted regression tests
from stderr_contains to stderr_only("shuf: memory exhausted\n") so they
verify the whole stderr, including the `shuf:` program-name prefix.
2026-06-01 07:50:35 +02:00
Daniel HofstetterandSylvestre Ledru b5fcae085d dircolors: use stdout_only in tests where possible 2026-05-30 16:17:14 +02:00
Daniel HofstetterandSylvestre Ledru 4834b3187d dircolors: improve test by ensuring stderr output 2026-05-30 16:17:14 +02:00
Lorenzo RossiandGitHub ed15a26a6a chown: -h on symlink to directory operates on link, not target (#12522)
closes: #11887
2026-05-30 14:29:58 +02:00
gabrielhnfandDaniel Hofstetter 840c36d396 shred: fix --remove=unlink with relative paths 2026-05-30 10:44:52 +02:00
fullwoodenshovelandGitHub 395d703593 stat: fix %N quoting of filenames containing control characters (#12330) 2026-05-29 18:51:06 +02:00