Commit Graph

19280 Commits

Author SHA1 Message Date
Daniel Hofstetter 797b8d68ba Revert "fix(renovate): do not update pinned dependencies" (#11977)
This reverts commit 33b9156667.
2026-05-05 22:11:52 +02:00
Daniel Hofstetter 05759a8592 yes: move import to the other imports (#12153) 2026-05-05 22:11:22 +02:00
mattsu b195b1de88 chmod: fix TOCTOU race in recursive traversal (#11918)
* chmod: fix TOCTOU race in recursive traversal

Use fchmodat2 (Linux 6.6+) with AT_SYMLINK_NOFOLLOW to prevent an
attacker from replacing a directory entry with a symlink between the
stat and chmod calls. Falls back to fchmodat on older kernels.

- Restrict fchmodat2 (syscall 452) to asm-generic architectures only
  (x86_64, x86, arm, aarch64, riscv)
- Add SAFETY comment on unsafe syscall block per project convention
- Add O_PATH + /proc/self/fd fallback for musl on kernel < 6.6
- Cache ENOSYS result with AtomicBool to skip fchmodat2 on old kernels
- Remove unnecessary nix::Mode round-trip on the fchmodat2 path
- safe_chmod_file() takes explicit SymlinkBehavior parameter
- Always pass NoFollow for regular entries during recursion
- Document residual TOCTOU in symlink branch as intentional for -L
- Add test verifying NoFollow chmod doesn't modify symlink target
- Update check-safe-traversal.sh to recognize fchmodat2
2026-05-05 22:06:06 +02:00
oech3 fb93f53b3a tee: add benchmark (#12134) 2026-05-05 21:41:13 +02:00
Daniel Hofstetter adce17fa26 ls: use lines() instead of split('\n') in test 2026-05-05 15:50:30 +02:00
oech3 39364b6e23 factor: remove unsafe str::from_utf8_unchecked 2026-05-05 14:42:27 +02:00
Guillem L. Jara f7ba1f9b07 chore(ls): test for sorting stability 2026-05-05 11:22:45 +02:00
Guillem L. Jara 779cb058cd fix(ls): disambiguate size sorting appropiately 2026-05-05 11:22:45 +02:00
Guillem L. Jara 5a25c70c16 fix(ls): respect sorting when grouping directories 2026-05-05 11:22:45 +02:00
oech3 3e3daaa347 yes: remove cfg & move ownership of buffer to fn exec 2026-05-05 10:25:10 +02:00
xtqqczze 6b75bae3ce chore(deps): update rust crate crc-catalog to 2.5.0 2026-05-05 08:49:52 +02:00
Daniel Hofstetter c23dc6769e ls: hide "paths" argument 2026-05-04 18:01:03 +02:00
Guillem L. Jara bf89c8bf22 chore(cp): move raw libc calls to rustix 2026-05-04 17:46:32 +02:00
Guillem L. Jara b5ba95b030 chore(cp): add rustix as dep 2026-05-04 17:46:32 +02:00
Dorian Péron 379fbbb77e uucore: make the automatic flush at the end of binaries opt-outable
... To avoid duplicate error message when the util already does the job
2026-05-04 14:19:37 +02:00
Dorian Péron dac86df588 cksum: stop checksum computation from panicking over write error 2026-05-04 14:19:37 +02:00
xtqqczze 2b6ba09c4a chore(deps): update rust crate kqueue-sys to v1.1.0 2026-05-04 14:14:54 +02:00
oech3 45a48a1365 yes: avoid kernel side length validation (#12115) 2026-05-04 10:12:43 +02:00
Sylvestre Ledru 4a69cf0c5e tr: drop '[:...:]' wrapper from invalid character class error (#12122) 2026-05-04 09:54:56 +02:00
Sylvestre Ledru 0b6a2f26e3 uucore/safe_copy: use rustix Mode flags to avoid mode_t width mismatch (#12140)
`Mode::from_bits_truncate(DEST_INITIAL_MODE)` failed to build on macOS
because `mode_t` is `u16` there but `u32` on Linux. Compose the mode
from `Mode::RUSR | Mode::WUSR` so the call is portable by construction
and self-documents the intent (read+write owner = 0o600).
2026-05-04 09:41:55 +02:00
Sylvestre Ledru 163103355a head: strip os error suffix from stdout write error message (#12121) 2026-05-04 09:38:54 +02:00
Sylvestre Ledru b2c4e0c125 factor: emit GNU 9.11 'is not a valid positive integer' for stdin input (#12137)
* factor: emit GNU's 'X is not a valid positive integer' wording

GNU's factor.c routes both stdin and command-line input through the same
print_factors() and reports invalid input as
  factor: 'X' is not a valid positive integer
Match that wording exactly so the new GNU 9.11 'nul4' test passes and
the 'cont' test no longer needs the warning/invalid-digit hunk in
tests_factor_factor.pl.patch.

* Add 'cmdline' to spell-checker ignore list
2026-05-04 09:31:59 +02:00
Sylvestre Ledru fdafdcac96 uucore: add safe_copy module with TOCTOU-resistant copy primitives (#12130) 2026-05-03 11:35:24 +02:00
oech3 a1aa3b97eb nohup: remove unsafe stub 2026-05-03 11:24:12 +02:00
oech3 af09954d5a uucore: do not use Linux specific fn at tests (#12128) 2026-05-03 09:57:43 +02:00