Commit Graph
19522 Commits
Author SHA1 Message Date
Sylvestre Ledru 0ec11a0083 ci: add minimal permissions to workflows 2026-06-06 08:30:43 +02:00
Sylvestre Ledru c5b3ba2987 add safe wrappers for umask and mknod to uucore
Add set_umask() and safe_mknod() wrappers in uucore::fs module.
These provide safe abstractions over the unsafe libc functions,
centralizing the unsafe blocks in one well-documented location.
2026-06-06 08:23:00 +02:00
Sylvestre Ledru bf28d51786 use env_helper in join benchmark
Replace unsafe env::set_var with env_helper::set_var in the
join benchmark for French locale testing.
2026-06-06 08:23:00 +02:00
Sylvestre Ledru d905ea8403 use env_helper functions in date locale tests
Replace unsafe env::set_var and env::remove_var calls with
env_helper functions in the date locale tests.
2026-06-06 08:23:00 +02:00
Sylvestre Ledru 110bc53fd9 uucore: create an helper file 2026-06-06 08:23:00 +02:00
Sylvestre Ledru acff994611 tests: use setup_test_locale helper in touch test
Replace manual unsafe env::set_var + setup_localization calls with
the new setup_test_locale helper function for cleaner test code.
2026-06-06 08:23:00 +02:00
Sylvestre Ledru 44ce7350f7 tests: use setup_test_locale helper in chown, dd, and df 2026-06-06 08:22:46 +02:00
Sylvestre Ledru 7c2174821e uucore: add setup_test_locale helper function 2026-06-06 08:22:46 +02:00
Zhang WenandGitHub 7f791b9cd7 Fix some new clippy warnings (#12645) 2026-06-06 07:52:15 +02:00
7cfc74e47f chcon: anchor recursive relabel resolution to traversal dirfd (#12566)
---------

Co-authored-by: can1357 <me@can.ac>
2026-06-05 22:58:32 +02:00
58040feb5c split: harden output open path against TOCTOU target swaps (#12565)
Co-authored-by: can1357 <me@can.ac>
2026-06-05 18:09:05 +02:00
Sylvestre Ledru 6b22fda6b9 ci: run check-toctou.sh in a dedicated TOCTOU job 2026-06-05 17:58:26 +02:00
Sylvestre Ledru 3222b4aa52 util: move touch/head TOCTOU checks into check-toctou.sh 2026-06-05 17:58:26 +02:00
Sylvestre LedruandGitHub c004672c5e mkfifo: drop path-based chmod to close TOCTOU race; switch to rustix (#10020) (#12174)
(except on mac)
2026-06-05 15:52:53 +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
Max AmbaumandGitHub 43536897e4 head: Fixed TOCTOU bug in checking of metadata (#12439)
* head: Fixed TOCTOU bug in checking of metadata

* Fixed missing import and qualification for windows
2026-06-05 13:18:15 +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
oech3andGitHub e63cc0c260 openbsd.yml: get additional free disk space (#12627) 2026-06-05 10:19:17 +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
renovate[bot]andDaniel Hofstetter 785860e1c5 chore(deps): update rust crate libfuzzer-sys to v0.4.13 2026-06-05 07:21:26 +02:00
oech3andGitHub 0ff88b5711 dd: support nocache on android, freebsd (#12602) 2026-06-04 21:32:31 +02:00
DevelandGitHub bd9f32f7ae numfmt: prevent panic if float precision specifier > 65535 (#12600) 2026-06-04 17:03:36 +02:00
Sylvestre LedruandGitHub d296f8d39f Merge pull request #12171 from sylvestre/toctou-touch
touch: drop O_TRUNC on create to close TOCTOU race (#10019)
2026-06-04 17:02:57 +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