1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 03:26:18 +00:00
Commit graph

15910 commits

Author SHA1 Message Date
Sylvestre Ledru
a89fc48388
Merge pull request #7656 from eduardorittner/main
printf: make negative values wrap around with unsigned/hex format
2025-04-10 06:48:50 -04:00
Sylvestre Ledru
eca400fcf3
Merge pull request #7689 from nyurik/inline2
chore: manual inline formatting
2025-04-10 06:42:01 -04:00
Sylvestre Ledru
593b141476
Merge pull request #7719 from cakebaker/uucore_fix_unresolved_import
uucore: add `chrono` to `uptime` feature
2025-04-10 06:07:02 -04:00
Daniel Hofstetter
b5df331170 uucore: add chrono to uptime feature 2025-04-10 10:59:27 +02:00
Sylvestre Ledru
64cf3f5dae
Merge pull request #7712 from drinkcat/parse_number_large_hex-fix
uucore: num_parser: Limit precision when computing 2**exp
2025-04-10 04:29:12 -04:00
Daniel Hofstetter
49e28e4d60
Merge pull request #7714 from uutils/renovate/linux-raw-sys-0.x-lockfile
chore(deps): update rust crate linux-raw-sys to v0.9.4
2025-04-10 07:17:26 +02:00
Sylvestre Ledru
efac771c83
Merge pull request #7713 from cakebaker/bump_hostname
Bump `hostname` & remove `windows-core` from skip list
2025-04-09 21:39:27 -04:00
Sylvestre Ledru
2103911d1a
Merge pull request #7717 from drinkcat/fuzz-minor-fixes
Fuzzing: minor fixes
2025-04-09 21:13:35 -04:00
Sylvestre Ledru
bf9a8b83f8
Merge pull request #7673 from lewisboon/df-thiserror
df: migrate OptionsError to thiserror
2025-04-09 21:11:49 -04:00
Lewis Boon
59d0e50397 df: migrate OptionsError to thiserror
Closes #7536
2025-04-09 22:32:45 +01:00
Yuri Astrakhan
2d95850700 chore: manual inline formatting
Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-09 15:33:46 -04:00
Nicolas Boichat
8f9bdf36fd workflows/fuzzing.yml: Add timeout equal to total run time
Just in case some of the values cause an infinite loop (or at
least take a _very_ long time, see #7708), timeout, with the same
duration as the maximum total fuzzing time.

That'll allow us to _see_ what input causes the infinite loop.
2025-04-09 21:04:43 +02:00
Nicolas Boichat
2caeaf511e fuzz: Run cargo clippy
Unfortunately, cargo clippy fails when testing fuzz_seq_parse_number:

```
error[E0603]: module `number` is private
  --> fuzz_targets/fuzz_seq_parse_number.rs:9:13
   |
9  | use uu_seq::number::PreciseNumber;
   |             ^^^^^^ private module
   |
note: the module `number` is defined here
  --> /home/drinkcat/dev/coreutils/coreutils/src/uu/seq/src/seq.rs:24:1
   |
24 | mod number;
   | ^^^^^^^^^^
```

But we can still fix the rest...
2025-04-09 20:58:30 +02:00
renovate[bot]
923d5aaa26
chore(deps): update rust crate linux-raw-sys to v0.9.4 2025-04-09 16:24:56 +00:00
Daniel Hofstetter
c8fc02a05d deny.toml: remove windows-core from skip list 2025-04-09 16:04:08 +02:00
Daniel Hofstetter
02ea63d2af Bump hostname from 0.4.0 to 0.4.1 2025-04-09 15:59:35 +02:00
Nicolas Boichat
4a13f4d14b uucore: num_parser: Limit precision when computing 2**exp
The number of digits would grow exponentially when large exponents
are passed, leading to conversion of numbers like 0x2p1000000 taking
forever to compute.

We use exponentiation by squaring to keep the precision within
reasonable bounds.

Fixes #7708.
2025-04-09 15:29:57 +02:00
Sylvestre Ledru
9cb4348a55
Merge pull request #7617 from MidnightRocket/mktemp/prevent-race-condition-tempdir-permissions
mktemp: Prevent race condition when setting permissions for tempdir
2025-04-09 07:04:33 -04:00
MidnightRocket
32fed17969
mktemp: Prevent race condition when setting permissions for tempdir
This prevents a race conditions vulnerability in the tempdir implementation, where an attacker
potentially could modify the created temporary directory, before the restrictive permissions are
set.

The race conditions occurs in the moment between the temporary directory is created, and the proper
permissions are set.

 # The fix

This patch changes the `make_temp_dir` to create the temporary directory with the proper
permissions creation time. Rather than first create, then set permissions.
This is done by giving the permissions to the builder.
See [tempfile doc](95540ed3fc/src/lib.rs (L449-L450)).

 # Severity Low

The attack is only possible if the umask is configured to allow writes by group or other for created
file/directories.

 # Related Resources

See: https://cwe.mitre.org/data/definitions/377.html
2025-04-09 11:18:09 +02:00
Daniel Hofstetter
ed8689eaa3
Merge pull request #7700 from nyurik/parens
chore: remove unneeded parens
2025-04-09 11:03:10 +02:00
Daniel Hofstetter
75a04c9cc0
Merge pull request #7709 from nyurik/workspace-clippy
Consolidate lint management with workspaces
2025-04-09 10:50:11 +02:00
Yuri Astrakhan
2413dc9168 Consolidate lint management with workspaces
At the moment, most crates rely on build scripts and other methods to keep lint-consistency. As of recent, Rust can use workspaces to globally set all the lint configurations.

This PR only adds lint configuration to each crate, but it does not introduce any changes to the code or lint configuration. In the subsequent PRs, I plan to gradually move lints from `uucore` to workspace, making all code consistent.

Note that `seq` relies on a custom lint config - which means its configuration may need to be managed by hand until Cargo introduces per-crate overrides.
2025-04-09 03:58:46 -04:00
Daniel Hofstetter
bb3b418052
Merge pull request #7707 from nyurik/clippy
Address new clippy lints
2025-04-09 09:40:52 +02:00
Nicolas Boichat
75072b5a98 fuzz: Run cargo fmt 2025-04-09 08:55:32 +02:00
Yuri Astrakhan
8b35439574 Address new clippy lints
Ran `cargo clippy --all-targets --workspace` and fixed a few minor issues
2025-04-09 01:10:01 -04:00
Daniel Hofstetter
04fe62bdd9
Merge pull request #7701 from uutils/renovate/bstr-1.x-lockfile
chore(deps): update rust crate bstr to v1.12.0
2025-04-09 07:07:32 +02:00
Yuri Astrakhan
d77470be2d fix clippy issues 2025-04-08 18:25:29 -04:00
Yuri Astrakhan
170831ed2b chore: remove unneeded parens
Keeps code a bit more readable
2025-04-08 18:19:03 -04:00
Sylvestre Ledru
6ea1f5247f
Merge pull request #7703 from nyurik/lints
feat: minor linting
2025-04-08 17:16:42 -04:00
Sylvestre Ledru
1abe65cfdb
Merge pull request #7696 from nyurik/id-fix
bug: fix id printing of egid
2025-04-08 17:01:31 -04:00
Sylvestre Ledru
0a99ab86e9
Merge pull request #7698 from nyurik/assert-eq
chore: use `assert_eq!` and `assert_ne!` instead of `assert!`
2025-04-08 17:00:58 -04:00
Yuri Astrakhan
249ef537fe feat: minor linting 2025-04-08 16:34:21 -04:00
renovate[bot]
8c055b4b20
chore(deps): update rust crate bstr to v1.12.0 2025-04-08 18:54:05 +00:00
Terts Diepraam
8040305715
Merge pull request #7622 from blyxxyz/flush-bufwriters
Flush `BufWriter`s, clean up error reporting
2025-04-08 20:52:51 +02:00
Yuri Astrakhan
a27880e8a3 chore: use assert_eq! and assert_ne! instead of assert!
Makes intent clearer, and if something fails, prints the values that caused the failure as part of the panic message.
2025-04-08 13:25:41 -04:00
Dan Hipschman
81911f9f6a numfmt: add --zero-terminated option 2025-04-08 10:05:26 -07:00
Yuri Astrakhan
a207f997a3 bug: fix id printing of egid
Spotted while doing format arg inlining, and confirmed in https://github.com/uutils/coreutils/pull/7689#issuecomment-2786827777
2025-04-08 12:19:44 -04:00
Daniel Hofstetter
a77e218a79
Merge pull request #7690 from nyurik/manual-inline
chore: manual inline formatting - tests
2025-04-08 15:27:14 +02:00
Daniel Hofstetter
c5a236d416
Merge pull request #7692 from uutils/renovate/half-2.x-lockfile
chore(deps): update rust crate half to v2.6.0
2025-04-08 09:34:57 +02:00
Daniel Hofstetter
7f8ad6a32c
Merge pull request #7688 from nyurik/fmt-inline
chore: use inline formatting
2025-04-08 09:31:17 +02:00
Daniel Hofstetter
8aaa8ff24d
Merge pull request #7691 from nyurik/commas
chore: cleanup trailing commas before parens
2025-04-08 08:15:54 +02:00
renovate[bot]
feb99dcf0d
chore(deps): update rust crate half to v2.6.0 2025-04-08 05:48:07 +00:00
Yuri Astrakhan
3dc771924c chore: cleanup trailing commas before parens
Deleted commas in cases like `foo,)` -- mostly in macros
2025-04-08 00:33:58 -04:00
Yuri Astrakhan
982805d3cd chore: manual inline formatting
Minor manual cleanup - inlined many format args.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.  Note that `&foo` in a `format!` parameter results in a 6% extra performance cost, and does not get inlined by the compiler (yet).
2025-04-08 00:23:21 -04:00
Yuri Astrakhan
47b10539d0 chore: use inline formatting
Minor cleanup using clippy autofix.  This makes the code a bit more readable, and helps spot a few inefficiencies and possible bugs.

```
cargo clippy --fix --workspace -- -A clippy::all -W clippy::uninlined_format_args && cargo fmt
```
2025-04-07 22:56:21 -04:00
Clifford Ressel
b7bf8c9467
chmod: Correct chmod -R on dangling symlink and tests (#7618)
* Correct chmod -R on dangling symlink and tests

* Add tests of arg-level symlink to chmod

* Add tests of all symlink flag combos on chmod dangling

* Fix no traverse on dangling symlink

* Add chmod recursive tests of default symlink method

* Add default chmod -H flag tests

* Set chmod default traversal method correctly to -H

* Fix arg symlink chmod case

* Remove extra chmod -H testing

---------

Co-authored-by: Clifford Ressel <EMAIL@gmail.com>
2025-04-07 16:18:00 +02:00
Dorian Péron
1b250fa75c
Merge pull request #7683 from uutils/renovate/codecov-codecov-action-5.x
chore(deps): update codecov/codecov-action action to v5
2025-04-07 14:30:13 +02:00
Sylvestre Ledru
ce0814134e
Merge pull request #7682 from uutils/renovate/mozilla-actions-sccache-action-0.x
chore(deps): update mozilla-actions/sccache-action action to v0.0.9
2025-04-07 12:40:51 +02:00
renovate[bot]
a40e4483fd
chore(deps): update codecov/codecov-action action to v5 2025-04-07 09:11:02 +00:00
renovate[bot]
232b083002
chore(deps): update mozilla-actions/sccache-action action to v0.0.9 2025-04-07 09:10:58 +00:00