Commit graph

8835 commits

Author SHA1 Message Date
Daniel Hofstetter
91cf001180 nl: use OsString for --number-separator 2025-08-24 17:35:34 +02:00
Etienne
bba4d99042
add support for systemd-logind (#8483)
Some checks are pending
CICD / Build/stable (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
Devcontainer / Verify devcontainer (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
WSL2 / Test (push) Waiting to run
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
L10n (Localization) / L10n/Build and Test (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/Clap Error Localization Test (push) Waiting to run
* add support for systemd-logind

Add support for systemd-logind for systems where `/var/run/utmp` does not exist any more (e.g. Ubuntu 25.04).

Here is some context explaining the switch from utmp to systemd-logind:
https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/

Fixes https://github.com/uutils/coreutils/issues/8376

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* fix duplicated boot record

When feature feat_systemd_logind is enabled and utmp is present, two boot records were printed.

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* improve error forwarding

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* remove unnecessary negation in if/else block

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

* use getpwuid_r() instead of getpwuid()

getpwuid() is not thread-safe.

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* improve error handling

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* use Path instead of string

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* use closure to reduce the number of clones() calls

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* use MaybeUninit instead of mem::zeroed()

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* systemd-logind: add some unit-tests

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* use sysconf(_SC_GETPW_R_SIZE_MAX) instead of 1024

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* fix cspell

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* add auto-enablement of feat_systemd_logind in GNUmakefile

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>

* Revert "add auto-enablement of feat_systemd_logind in GNUmakefile"

This breaks "Tests/BusyBox test suite" in CI.

This reverts commit 16626d4653.

---------

Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2025-08-23 19:05:40 +02:00
Daniel Hofstetter
703084ee5e date: allow multiple -d, last wins 2025-08-22 10:16:17 +02:00
Sylvestre Ledru
c8af206424
Merge pull request #8495 from cakebaker/rm_fix_unused_var
rm: fix unused var warning on non-(unix & windows)
2025-08-21 14:15:16 +02:00
Sylvestre Ledru
8a248c39eb
Merge pull request #8497 from cakebaker/head_refactor_uumain
head: refactor `uumain`
2025-08-20 19:04:48 +02:00
Sylvestre Ledru
1bcaea3023 tr: refactor and introduce simd to get important perf win 2025-08-20 11:52:20 +02:00
Daniel Hofstetter
d4f68b5053 head: remove _NAME suffix from constants 2025-08-19 15:39:07 +02:00
Daniel Hofstetter
60b2df0b6b head: use map_err instead of match in uumain 2025-08-19 15:33:30 +02:00
Daniel Hofstetter
c47a4e6eaf rm: replace #[cfg(not(windows))] with #[cfg(unix)] 2025-08-19 11:40:40 +02:00
Daniel Hofstetter
f9b6e36d54 rm: group handle_writable_directory functions 2025-08-19 11:36:05 +02:00
Daniel Hofstetter
df16ef930c rm: fix unused var warning on non-(unix & windows) 2025-08-19 11:32:58 +02:00
Sylvestre Ledru
f9e3d5b531
Merge pull request #8484 from cakebaker/head_remove_bad_encoding_variant
Some checks are pending
CICD / Dependencies (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Build/nightly (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
L10n (Localization) / L10n/Build and Test (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/Clap Error Localization Test (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
WSL2 / Test (push) Waiting to run
CICD / Binary sizes (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
head: remove `BadEncoding` variant of `HeadError`
2025-08-16 22:29:28 +02:00
Daniel Hofstetter
9e50f7f5c6
Merge pull request #8478 from Anonymous-AAA/fix-cp-socket-file-unix
Some checks are pending
CICD / Build/stable (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Test all features separately (push) Blocked by required conditions
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/lint (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/Clap Error Localization Test (push) Waiting to run
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
L10n (Localization) / L10n/Build and Test (push) Waiting to run
WSL2 / Test (push) Waiting to run
cp: fix recursive socket file copy
2025-08-15 11:19:22 +02:00
Daniel Hofstetter
6f258491d0 head: remove BadEncoding variant of HeadError 2025-08-15 10:15:43 +02:00
Daniel Hofstetter
59815b3e97
Merge pull request #8482 from sylvestre/l10n-2
Some checks are pending
Code Quality / Style/lint (push) Waiting to run
CICD / Build/Makefile (push) Blocked by required conditions
CICD / Build/stable (push) Blocked by required conditions
CICD / Binary sizes (push) Blocked by required conditions
CICD / Build (push) Blocked by required conditions
CICD / Tests/BusyBox test suite (push) Blocked by required conditions
CICD / Tests/Toybox test suite (push) Blocked by required conditions
CICD / Code Coverage (push) Waiting to run
CICD / Separate Builds (push) Waiting to run
CICD / Build/SELinux (push) Blocked by required conditions
GnuTests / Run GNU tests (native) (push) Waiting to run
GnuTests / Run GNU tests (SELinux) (push) Waiting to run
GnuTests / Aggregate GNU test results (push) Blocked by required conditions
Android / Test builds (push) Waiting to run
Code Quality / Style/format (push) Waiting to run
Code Quality / Style/spelling (push) Waiting to run
FreeBSD / Style and Lint (push) Waiting to run
FreeBSD / Tests (push) Waiting to run
Code Quality / Style/toml (push) Waiting to run
Code Quality / Style/Python (push) Waiting to run
Code Quality / Pre-commit hooks (push) Waiting to run
L10n (Localization) / L10n/Build and Test (push) Waiting to run
L10n (Localization) / L10n/Fluent Syntax Check (push) Waiting to run
L10n (Localization) / L10n/Clap Error Localization Test (push) Waiting to run
L10n (Localization) / L10n/French Integration Test (push) Waiting to run
L10n (Localization) / L10n/Multi-call Binary Install Test (push) Waiting to run
L10n (Localization) / L10n/Installation Test (Make & Cargo) (push) Waiting to run
L10n (Localization) / L10n/Locale Support Verification (push) Waiting to run
L10n (Localization) / L10n/Locale Embedding Regression Test (push) Waiting to run
WSL2 / Test (push) Waiting to run
sort: adjust the behavior of 'sort --output --file-with-dash' to match GNU's
2025-08-15 09:44:32 +02:00
Sylvestre Ledru
d9f17ccb02 sort: adjust the behavior of 'sort --output --file-with-dash' to match GNU's 2025-08-14 20:55:20 +02:00
Alen Antony
09b5b0daaa
Merge branch 'main' into fix-cp-socket-file-unix 2025-08-14 18:39:45 +05:30
Sylvestre Ledru
1c5b95d1bb non-utf8: address review commits 2025-08-14 10:54:17 +02:00
Sylvestre Ledru
5930ba0eb5 head: refactor the code a bit 2025-08-14 10:54:17 +02:00
Sylvestre Ledru
83e5be8a52 install: options support non-ut8 too 2025-08-14 10:54:17 +02:00
Sylvestre Ledru
66a1fc8bbf mktemp: options support non-ut8 too 2025-08-14 10:54:17 +02:00
Sylvestre Ledru
5a6986d55f split: prefix & suffix also support non-utf8 2025-08-14 10:54:04 +02:00
Sylvestre Ledru
39fbdeecb2 tac/touch: fix support non-utf-8 2025-08-14 10:53:55 +02:00
Sylvestre Ledru
a15f9646e8 realpath/split: fix support non-utf-8 2025-08-14 10:53:38 +02:00
Sylvestre Ledru
f450505e6e ptx: write_traditional_output also support non-utf8 2025-08-14 10:52:45 +02:00
Sylvestre Ledru
f65c36d609 address review comments 2025-08-14 10:52:37 +02:00
Sylvestre Ledru
344798e144 Update src/uu/readlink/src/readlink.rs
Co-authored-by: Nicolas Boichat <nicolas@boichat.ch>
2025-08-14 10:52:37 +02:00
Sylvestre Ledru
a7f3cb0209 realpath: fix regression with empty string validation
Fixes issue introduced in b965c944837df66b233f57fca7275fbed4e4d311 where
switching from NonEmptyStringValueParser to OsString parser removed
validation that arguments cannot be empty strings.

- Add custom NonEmptyOsStringParser that validates OsString is not empty
- Use the parser for FILES, --relative-to, and --relative-base arguments
- Add test case to verify empty strings are rejected with exit code 1
- Fixes GNU realpath test failure
2025-08-14 10:52:37 +02:00
Sylvestre Ledru
1ab3a8df4f address review comments 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
faf3f7e526 head: remove old test that we know support it 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
741370d771 Fix tac to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
ba7d902e50 Fix tsort to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
596784e70e Fix base64/base32/basenc to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
a69e6c9bd3 Fix dircolors to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
b46188cdb2 Fix nl to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
373aafc5ff Fix ptx to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
b5f8931b17 Fix stdbuf to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
f02436be0f Fix expand to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
8b38336036 Fix pathchk to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
d45113f574 Fix paste to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
581edf09d3 Fix chgrp to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
b91eb4266f Fix split to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
89f434d2bc Fix fmt to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
20793600f7 Fix csplit to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
39b7721464 Fix install to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
fddaa1187a Fix sum to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
6e55a2a3bb Fix cut to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
693bdd7748 Fix truncate to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
b54d999cc6 Fix more to handle non-UTF-8 filenames 2025-08-14 10:52:24 +02:00
Sylvestre Ledru
0706675830 Fix mktemp to handle non-UTF-8 templates 2025-08-14 10:52:24 +02:00