Commit Graph

85440 Commits

Author SHA1 Message Date
Cathy Hu
99debe91cd journal-remote test: add -Z in mkdir for journal-{remote,upload}.conf.d
Otherwise on SELinux enabled systems with the "targeted" policy
the type is not set correctly when run via unconfined user and
the test fails.

(cherry picked from commit 57202fd181)
2026-02-06 14:29:10 +00:00
Nick Rosbrook
798a27a5b4 ukify: omit .osrel section when --os-release= is empty
The primary motivation for this is to allow users of ukify to build
UKI-like objects, without having them later be detected as a UKI by
tools like kernel-install and bootctl.

The common code used by these tools to determine if a PE binary is a UKI
checks that both .osrel and .linux sections are present. Hence, adding
a mechansim to skip .osrel provides a way to avoid being labeled a UKI.

(cherry picked from commit 75890d949f)
2026-02-06 14:29:10 +00:00
Pablo Fraile Alonso
778963a0a2 shared/edit-util: ignore ENOTDIR when trying editors
(cherry picked from commit fd8d4026d4)
2026-02-06 14:29:10 +00:00
Yu Watanabe
e4d5985e93 test-time-util: ignore failure on MSK timezone
Ignore the following failures:
- with glibc
```
TZ=Europe/Volgograd, tzname[0]=MSK, tzname[1]=MSD
@1414277092997572 → Sun 2014-10-26 01:44:52 MSK → @1414273492000000 → Sun 2014-10-26 01:44:52 MSK
src/test/test-time-util.c:448: Assertion failed: Expected "ignore" to be true
```
- with musl
```
TZ=Europe/Kirov, tzname[0]=MSK, tzname[1]=MSK
@1414277092997572 → Sun 2014-10-26 01:44:52 MSK → @1414273492000000 → Sun 2014-10-26 01:44:52 MSK
src/test/test-time-util.c:448: Assertion failed: Expected "ignore" to be true
```

(cherry picked from commit 47d70d3a1b)
2026-02-06 14:29:10 +00:00
Tobias Stoeckmann
cbcf51881c nss-systemd: add unit test for sg_adm/sg_mem
Add a test for getsgnam_r to verify that sg_adm and sg_mem always point
to a NULL-terminated string vector.

Extend the gr_mem check of struct group for non-NULL values as well.

(cherry picked from commit 2eaca3ea5f)
2026-02-06 14:29:10 +00:00
Tobias Stoeckmann
dbbb79f550 nss-systemd: set sg_adm/sg_mem for all groups
Fill sg_adm and sg_mem in nss_pack_group_record_shadow to stay
compatible with other NSS getsgnam implementations which set these
members to NULL terminated string arrays.

Tools like shadow's sg would trigger a NULL pointer dereference with
groups only found through nss-systemd otherwise.

(cherry picked from commit 57682793da)
2026-02-06 14:29:10 +00:00
Tobias Stoeckmann
bcdb791e9c nss-systemd: set sg_adm/sg_mem in intrinsic groups
The sg_adm and sg_mem fields are supposed to point to a NULL terminated
string array. If these are NULL, some foreign tools like shadow's sg
trigger NULL pointer dereferences (or fortunately their asset() calls).

(cherry picked from commit 239903d44c)
2026-02-06 14:29:10 +00:00
Zbigniew Jędrzejewski-Szmek
2c96c1f8fe TEST-46-HOMED: fix 2 minute timeout in cleanup
The test passes but for two minutes the cleanup function just logs:
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
Failed to inspect home: No home for user homedsshtest known
...

Do not wait for the user to become inactive or remove the user if 'homectl
inspect' doesn't find the user. This brings a successfull run from 176 s
to 58 s here.

(cherry picked from commit 689391f8c8)
2026-02-06 14:29:10 +00:00
Lennart Poettering
2fd9ea8490 analyze: properly handle nvpcrs that have not been initialized yet
Let's explicitly check if NvPCRs are fully set up (allocated, anchored)
before we try to show them.

Alternative to: #40184

(cherry picked from commit 855b4cd731)
2026-02-06 14:29:10 +00:00
DaanDeMeyer
fcb1c33d69 repart: Don't silence mkfs.erofs if on a tty
mkfs.erofs is only sometimes verbose when not on a TTY, so let's not
silence it if we're on a TTY.

(cherry picked from commit 4d6274a6f4)
2026-02-06 14:29:10 +00:00
Ulrich Ölmann
a55845239b man/systemctl: fix typo
(cherry picked from commit dc3078e3a9)
2026-02-06 14:29:10 +00:00
Yu Watanabe
87ad6694ec man: drop redundant 'and'
Also swap the order of entries, to make it consistent for other unit
types.

Follow-up for 79dd24cf14.

(cherry picked from commit 33340fbe44)
2026-02-06 14:29:10 +00:00
tuhaowen
103baee487 udev/scsi_id: increase MAX_SERIAL_LEN from 256 to 512
The current MAX_SERIAL_LEN value of 256 is insufficient for some SCSI
devices with non-standard serial number lengths. In do_scsi_page80_inquiry(),
the required buffer length is calculated as:

    len = 1 + VENDOR_LENGTH + MODEL_LENGTH + buf[3]
        = 1 + 8 + 16 + buf[3]
        = 25 + buf[3]

where buf[3] contains the serial number length reported by the device.
According to the SCSI specification, this field is an unsigned 8-bit
value, meaning it can theoretically be up to 255 bytes. This results
in a maximum required length of 280 bytes, exceeding the current limit
of 256 bytes.

When this occurs, scsi_id fails with an error message like:
    "length 256 too short - need 280"

This has been observed with certain vendor devices that report unusually
long serial numbers in VPD page 0x80.

Increase MAX_SERIAL_LEN to 512 to accommodate the maximum possible
serial number length plus all required prefixes (vendor, model, and
type identifiers), providing sufficient headroom for non-compliant
devices while maintaining reasonable memory usage.

Signed-off-by: tuhaowen <tuhaowen@uniontech.com>
(cherry picked from commit 3c586354aa)
2026-02-06 14:29:10 +00:00
Franck Bui
9a83eee32f core/transaction: when isolating, keep triggered units only if their triggers are actually active
Follow-up for 32d6707dd1.

Co-authored-by: Mike Yuan <me@yhndnzj.com>
(cherry picked from commit 8e92910b98)
2026-02-06 14:29:10 +00:00
Ben Boeckel
487ad1c9db docs/PASSWORD_AGENTS: document the AcceptCached= field
(cherry picked from commit 0d15b2304b)
2026-02-06 14:29:10 +00:00
Ben Boeckel
59d7895d48 docs/PASSWORD_AGENTS: document the Silent= field
(cherry picked from commit 9f4606c361)
2026-02-06 14:29:10 +00:00
Ben Boeckel
f5a743ebe8 docs/PASSWORD_AGENTS: clarify that Echo=0 may obscure
(cherry picked from commit dc08cb1eb8)
2026-02-06 14:29:10 +00:00
Ben Boeckel
d526f7ce75 docs/PASSWORD_AGENTS: note that the user directory may be created
(cherry picked from commit 19d7ce2f7b)
2026-02-06 14:29:10 +00:00
DaanDeMeyer
0c12b14d2c docs: Add explicit reference to unprivileged userns docs of mkosi
Fixes #40216

(cherry picked from commit f3c67f7e16)
2026-02-06 14:29:10 +00:00
Daan De Meyer
791cb59b3f repart: Fix --defer-partitions-empty= docs
Fixes #40176

(cherry picked from commit 64991b2148)
2026-02-06 14:29:10 +00:00
Luca Boccassi
404f798fb3 test: fix (again) race condition in TEST-80-NOTIFYACCESS
Even with the previous fix, it can still happen that pid1
sends SIGHUP to the script after 'sdnotify --ready' but before
'wait', so the test can still get stuck:

[ 2444.373448] reload-timeout.sh[158]: + set -o pipefail
[ 2444.373502] reload-timeout.sh[158]: + COUNTER=0
[ 2444.373590] reload-timeout.sh[158]: + trap sighup_handler SIGHUP
[ 2444.373639] reload-timeout.sh[158]: + export SYSTEMD_LOG_LEVEL=debug
[ 2444.373670] reload-timeout.sh[158]: + SYSTEMD_LOG_LEVEL=debug
[ 2444.373790] reload-timeout.sh[158]: + wait_for_signal 1
[ 2444.373871] reload-timeout.sh[158]: + local notify=1
[ 2444.373912] reload-timeout.sh[158]: + local p
[ 2444.374079] reload-timeout.sh[158]: + p=159
[ 2444.374123] reload-timeout.sh[159]: + sleep infinity
[ 2444.375358] systemd[1]: reload-timeout.service: Got notification message from PID 158: READY=1
[ 2444.375363] systemd[1]: reload-timeout.service: Changed start -> running
[ 2444.375368] systemd[1]: reload-timeout.service: Job 294 reload-timeout.service/start finished, result=done
[ 2444.375374] systemd[1]: Started reload-timeout.service.
[ 2444.375766] systemd[1]: reload-timeout.service: Failed to send unit change signal for reload-timeout.service: Connection reset by peer
[ 2444.376464] reload-timeout.sh[158]: + '[' 1 -eq 1 ']'
[ 2444.376464] reload-timeout.sh[158]: + systemd-notify --ready
[ 2444.376518] TEST-80-NOTIFYACCESS.sh[157]: Job for reload-timeout.service finished.
[ 2444.376518] TEST-80-NOTIFYACCESS.sh[157]: Got result done/Success for job reload-timeout.service.
[ 2444.376518] TEST-80-NOTIFYACCESS.sh[157]: Bus n/a: changing state RUNNING → CLOSED
[ 2444.376952] TEST-80-NOTIFYACCESS.sh[92]: + systemctl reload --no-block reload-timeout.service
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state UNSET → OPENING
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Executing dbus call org.freedesktop.systemd1.Manager ReloadUnit(reload-timeout.service, replace)
[ 2444.379548] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 2444.379910] systemd-notify[160]: Notify message sent to '/run/systemd/notify': "READY=1"
[ 2444.379931] systemd-notify[160]: Notify message sent to '/run/systemd/notify': "BARRIER=1"
[ 2444.382218] systemd[1]: reload-timeout.service: Trying to enqueue job reload-timeout.service/reload/replace
[ 2444.382241] systemd[1]: reload-timeout.service: Installed new job reload-timeout.service/reload as 366
[ 2444.382248] systemd[1]: reload-timeout.service: Enqueued job reload-timeout.service/reload as 366
[ 2444.383905] systemd[1]: reload-timeout.service: Service has no extensions to reload.
[ 2444.384925] systemd[1]: reload-timeout.service: Changed running -> reload-signal
[ 2444.384935] systemd[1]: Reloading reload-timeout.service...
[ 2444.386410] reload-timeout.sh[158]: ++ sighup_handler
[ 2444.386410] reload-timeout.sh[158]: ++ echo hup1
[ 2444.386455] TEST-80-NOTIFYACCESS.sh[161]: Bus n/a: changing state RUNNING → CLOSED
[ 2444.386555] TEST-80-NOTIFYACCESS.sh[92]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-signal" ]]; do sleep .5; done'
[ 2444.395566] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state UNSET → OPENING
[ 2444.395566] TEST-80-NOTIFYACCESS.sh[165]: sd-bus: starting bus by connecting to /run/systemd/private...
[ 2444.396041] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state OPENING → AUTHENTICATING
[ 2444.396041] TEST-80-NOTIFYACCESS.sh[165]: Showing one /org/freedesktop/systemd1/unit/reload_2dtimeout_2eservice
[ 2444.401911] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state AUTHENTICATING → RUNNING
[ 2444.401911] TEST-80-NOTIFYACCESS.sh[165]: Bus n/a: changing state RUNNING → CLOSED
[ 2444.403806] TEST-80-NOTIFYACCESS.sh[92]: + sync_in hup1
[ 2444.403806] TEST-80-NOTIFYACCESS.sh[92]: + read -r x
[ 2444.403964] reload-timeout.sh[158]: + wait 159
[ 2444.403988] TEST-80-NOTIFYACCESS.sh[92]: + test hup1 = hup1
[ 2444.403988] TEST-80-NOTIFYACCESS.sh[92]: + timeout 10 bash -c 'until [[ $(systemctl show reload-timeout.service -P SubState) == "reload-notify" ]]; do sleep .5; done'

Try to check if the signal handler has ran by checking the counter,
and avoid waiting and immediately return if it has changed

Fixes https://github.com/systemd/systemd/issues/39581

Follow-up for 8fba2ed258

(cherry picked from commit 8d1e58f9fd)
2026-02-06 14:29:10 +00:00
Lennart Poettering
e94f44085f userdbctl: add missing --uuid= to --help text
Follow-up for: 466562c69b

(cherry picked from commit f42ac24772)
2026-02-06 14:29:10 +00:00
Luca Boccassi
8fe6f3bcb1 tools: use -f in mkosi summary in fetch-distro.py
$ ./tools/fetch-distro.py -u fedora
+ mkosi --json -d fedora summary
‣ Ignoring --distribution from the CLI. Run with -f to rebuild the image with this setting

Follow-up for 35f6e5c327

(cherry picked from commit 2791af18e4)
2026-02-06 14:29:09 +00:00
seidlerv
24a51e02ac man/org.freedesktop.systemd1.xml: Fix wording
(cherry picked from commit bd6d8eec5e)
2026-02-06 14:29:09 +00:00
Daan De Meyer
44eb4bbeef test-user-util: Migrate to new assertion macros
(cherry picked from commit 9d10457a3e)
2026-02-06 14:29:09 +00:00
Mike Yuan
f2f2c2c9bf logs-show: match init.scope rather than _PID=1 for UNIT=
We should consider the whole init.scope trusted, and any
process trying to log on behalf of a unit there should be
attributed as so.

Follow-up for 4f25248b6e
Only with this commit is the change in effect.

(cherry picked from commit 7f9e3c5919)
2026-02-06 14:29:09 +00:00
Miao Wang
16e9301c6c ssh-proxy: expect OK PORT response from vsock-mux
The unix-domain socket to AF_VSOCK multiplexers in Firecracker and
vhost-device-vsock sends OK PORT response to the client, resulting
ssh clients to abort the connection with the additional response. This
patch addresses this issue by waiting and expecting the possible OK PORT
response from the multiplexer, if any, and then handover the socket fd
to the ssh client. It only checks if the response begins with OK and
consume the response till the first \n, for simplicity.

Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
(cherry picked from commit dc3e544104)
2026-02-06 14:29:09 +00:00
Luca Boccassi
b6d30cdebd Revert "tests: run qemu with cpu_reset,guest_errors debug messages"
This reverts commit b169c7512c.

(cherry picked from commit 84079cd158)
2026-02-06 14:29:09 +00:00
Luca Boccassi
f91ed1dff8 Revert "tests: also add qemu shutdown trace debug logs to integration script"
This reverts commit 9b42cc3b12.

(cherry picked from commit d6514ebf33)
2026-02-06 14:29:09 +00:00
Luca Boccassi
b1bfc07500 Revert "integration-test: check tools distribution rather than image distribution"
This reverts commit fd2cdadc14.

(cherry picked from commit 293a925e9e)
2026-02-06 14:29:09 +00:00
Franck Bui
f8c5b96c84 man: generate systemd-tpm2-generator man page only when ENABLE_BOOTLOADER is enabled
(cherry picked from commit 25393c7c90)
2026-02-06 14:29:09 +00:00
Daan De Meyer
7c81578ddf openssl-util: Fix logging
(cherry picked from commit 8ecb7deafa)
2026-02-06 14:29:09 +00:00
Luca Boccassi
269460bcb2 fido2: fix enrolling when UV is required ('alwaysUv')
When a Yubikey or other fido2 device has FIPS mode enabled, UV will
always be required and cannot be disabled. Unhelpfully, when it is not
sent down, the hardware token (not the library) returns a generic
FIDO_ERR_MISSING_PARAMETER:

$ systemd-cryptenroll --fido2-device=auto --fido2-with-client-pin=no foo
<...>
libfido2: rx: payload_len=1
libfido2: fido_rx: buf=0x55c9ce170940, len=1
libfido2: 0000: 14
libfido2: cbor_parse_reply: blob[0]=0x14
libfido2: fido_dev_get_assert_rx: adjust_assert_count
Failed to ask token for assertion: FIDO_ERR_MISSING_PARAMETER

This can be set even when the token doesn't support UV (as in, fingerprint
reader), in which case using the PIN is required.

Check if 'alwaysUv' is set, and if not already configured, force
either UV (if available) or PIN when enrolling.

(cherry picked from commit 9a34971421)
2026-02-06 14:29:09 +00:00
Lennart Poettering
f6dcbc0828 bash: clarfiy what 80-systemd-osc-context.sh is about in the spec
(cherry picked from commit 18d90c1628)
2026-02-06 14:29:09 +00:00
Lennart Poettering
36dd990ee2 docs: add redirection of the osc context to uapi website
(cherry picked from commit d91aed3b55)
2026-02-06 14:29:09 +00:00
Mike Yuan
985952c920 core/dbus-execute: respect write flags for empty assignments too
(cherry picked from commit 16bae207c2)
2026-02-06 14:29:09 +00:00
Yu Watanabe
2411010149 test: use test-sleep executable in softreboot and coredump tests
This partially reverts 355bcc243c.

(cherry picked from commit 28826f6ba9)
2026-02-06 14:29:09 +00:00
Yu Watanabe
11453a6be0 test: introduce our own sleep command for testing
(cherry picked from commit 4c98063d6e)
2026-02-06 14:29:09 +00:00
Yu Watanabe
b1e6cce085 time-util: make usleep_safe() support USEC_INFINITY
(cherry picked from commit 78385b8e94)
2026-02-06 14:29:09 +00:00
Yu Watanabe
7898d04c34 time-util: continue sleeping when clock_nanosleep() fail with EINTR
The function clock_nanosleep() provides remaining time when failed with
EINTR. Let's continue sleeping in that case.

(cherry picked from commit b8241d3ca5)
2026-02-06 14:29:09 +00:00
Luca Boccassi
560677fcbb firstboot/homectl: hide plymouth splashscreen when asking questions
When plymouth is enabled, the screen gets all garbled when firstboot
runs and asks questions. Disable the splash screen, but only when
actually asking questions.

(cherry picked from commit 75cb25c0b9)
2026-02-06 14:29:09 +00:00
Luca Boccassi
2214421f9e vmspawn: do not pass console=hvc0 in GUI mode
This breaks when using qemu's GUI mode. Follow mkosi's example.

Follow-up for 773ca1def8

(cherry picked from commit 610d8c3dfc)
2026-02-06 14:29:09 +00:00
Antonio Alvarez Feijoo
c15c18114f import-generator: fix sysext/confext ordering in initrd
In the initrd, order the generated `systemd-import@.service` units before the
initrd-specific sysext/confext units.

(cherry picked from commit 2f76b10b94)
2026-02-06 14:29:09 +00:00
Luca Boccassi
fd9cea4d94 ask-password: install polkit policy
The policy was added, but never hooked into meson to be installed,
so it's unused. Install it.

Follow-up for 066f6bfb62

(cherry picked from commit ce41216e49)
2026-02-06 14:29:09 +00:00
Zbigniew Jędrzejewski-Szmek
93021d397d ask-password: remove files in /run when query is aborted
Because of the missing 'goto', if the query was aborted, we
would leave behind the ask.* ini file.

(cherry picked from commit 65f72f5dbb)
2026-02-06 14:29:09 +00:00
Zbigniew Jędrzejewski-Szmek
0ed548e334 ask-password: reject control chars and quotes in query description
As reported in https://yeswehack.com/vulnerability-center/reports/705270,
YesWeHack issue #YWH-PGM9780-66, if a newline is injected into the message
field, it is passed through unmolested and lands in the .ini file. This
obviously would cause the parser to be confused.

Let's forbid any control characters or quotes in those fields. If we want
something more complicated in the future, we can add a custom validation
function and allow some escaping mechanism.

(cherry picked from commit f01c99c67e)
2026-02-06 14:29:09 +00:00
Yu Watanabe
61587a6c16 bus-unit-util: convert StandardInputText to StandardInputData
Fixes #40527.

(cherry picked from commit c3540c80a5)
2026-02-06 14:29:09 +00:00
Ivan Shapovalov
a54d78841b network: fix max MTU check for IPv6 MTU adjustments
When link MTU is being adjusted in an IPv6 context (e.g., according to
the MTU received in an RA), the new MTU is clamped against link's
current MTU than link's max MTU. This means that the link MTU can never
be increased via an RA:

    systemd-networkd[10068]: eth1: Reducing requested IPv6 MTU 8900 to the interface's maximum MTU 1500.
    systemd-networkd[10068]: Setting '/proc/sys/net/ipv6/conf/eth1/mtu' to '1500'
    systemd-networkd[10068]: No change in value '1500', suppressing write

Fix this check to make logical sense, and also to match a similar check
in src/network/networkd-setlink.c:link_adjust_mtu().

(cherry picked from commit 32417c1723)
2026-02-06 14:29:09 +00:00
Yu Watanabe
29f62eeedf bus-unit-util: make ExecSearchPath= accepts colon separated list
Unlike other settings that takes multiple values, the setting takes
colon separated list of paths, but when specified as a DBus property,
it previously accepted space separated list of paths.
Let's also make the DBus property accepts colon separated lists.

Fixes #40513.

(cherry picked from commit da912e7f2f)
2026-02-06 14:29:09 +00:00
Yu Watanabe
57953f0d1d udev: create /run/udev/queue file earlier
When udevd received a uevent or inotify event, we will queue or trigger
synthesized events. To minimize the race between processing these events
by udevd and user invocation of 'udevadm settle', let's create /run/udev/queue
file earlier.
On some errors, no event may be queued, but in that case, the file will
be removed by the post event source if nothing queued. See on_post().

Hopefully mitigate the issue #40499.

(cherry picked from commit dc709eff0b)
2026-02-06 14:29:09 +00:00