]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 hours agohwdb: mark Razer BlackShark V3 Pro as headset main
rashidmya [Sun, 9 Aug 2026 13:10:47 +0000 (17:10 +0400)] 
hwdb: mark Razer BlackShark V3 Pro as headset

The BlackShark V3 Pro wireless dongle (1532:0577) exposes a sound card
that is not detected as a headset, since neither the model name nor the
USB interfaces provide a usable hint. Add a quirk so the form factor is
reported correctly.

35 hours agovmspawn: keep parsing options after the first argument
Daan De Meyer [Sat, 8 Aug 2026 09:39:16 +0000 (11:39 +0200)] 
vmspawn: keep parsing options after the first argument

vmspawn's positional arguments are extra kernel command line arguments
rather than a command to execute, so unlike nspawn or run it has nothing
to shield from the option parser: a kernel command line argument never
begins with a dash. Stopping at the first one only means an option that
follows one is silently taken for another kernel command line argument,
with no diagnostic:

    systemd-vmspawn -i image.raw console=ttyS0 --set-credential=foo:bar

boots with "--set-credential=foo:bar" appended to the kernel command
line instead of setting a credential.

The stop was right when it was written. In 9de3cc1484, vmspawn's first
commit, the trailing arguments were appended to the QEMU command line
directly, so they really were options that had to reach QEMU unparsed.
4291f4461e turned them into extra kernel command line arguments passed
through SMBIOS three weeks later, and updated the man page to say so,
but left the "+" in the optstring behind; 4c778c51c0 and 5ff0ccaf8b then
carried it into the new option parser as
OPTION_PARSER_STOP_AT_FIRST_NONOPTION.

Use the default parser mode, which permutes options ahead of the
arguments; "--" still ends option parsing for an argument that does look
like an option. test-options gains the case this turns on, an option
after a positional argument in the default mode, beside the existing one
for the mode vmspawn no longer uses.

2 days agoresolvectl: render DNS errors as JSON
dongshengyuan [Fri, 7 Aug 2026 06:19:06 +0000 (14:19 +0800)] 
resolvectl: render DNS errors as JSON

When --json is requested, resolution errors returned by resolved still went
through text logging. That made scripts parse stderr even though the
varlink error already carried structured fields such as rcode and EDE.

Add a small JSON error dumper for resolvectl query errors. It outputs the
queried name and varlink error id alongside the original varlink parameters
so DNSError and DNSSECValidationFailed expose rcode, extendedDNSErrorCode,
extendedDNSErrorMessage, queryString, and result without duplicating the
schema in resolvectl.

Keep non-JSON text output and silent warn_missing NXDOMAIN handling
unchanged. Document the JSON resolution error object in resolvectl(1),
including the distinction between resolved errors and local invocation or
connection errors.

Closes #42904

2 days agokernel-install: configurable entry name format (#43290)
Yu Watanabe [Fri, 7 Aug 2026 19:09:10 +0000 (04:09 +0900)] 
kernel-install: configurable entry name format (#43290)

For some of us building image based operating systems with
`systemd-sysupdate` it's useful to have UKI filenames that encode
`IMAGE_VERSION` (and architecture). For example
`SimonOS_45.20260805.0_x86-64.efi`.

Currently to do this I have to manually post-process around the `.efi`
produced by `60-ukify` because it is named
`$ENTRY_TOKEN-$KERNEL_VERSION.efi`. It'd be very useful if I could skip
that step and instead have the image built directly without this
post-processing step; then extract the UKI and /usr partitions and plop
them onto my update server. It makes the build much more "install RPMs
into a tree and you're done" (barring other things `60-ukify` currently
can't do but I have follow-ups for those in mind).

This PR adds a knob to `install.conf` to let users specify a custom
format for the output filename for both UKI's and BLS entries produced
by `kernel-install`.

It accepts the following specifiers:

- `%e`: entry token
- `%v`: kernel version being installed
- Several common specifiers

The default is %e-%v, which is the current behavior. With
`entry_name_format=%M_%A_%a`, an OS with `IMAGE_ID=SimonOS` and
`IMAGE_VERSION=1.0` would get moved to `SimonOS_1.0_x86-64.efi`.

The resolved name is exported as `$KERNEL_INSTALL_ENTRY_NAME` for shell
plugins. Both `90-uki-copy.install` and `90-loaderentry.install` are
updated to use it, with a fallback to `$ENTRY_TOKEN-$KERNEL_VERSION` for
compatibility with older kernel-install versions.

2 days agosd-journal: prefer machine ID from the tail entry
Frantisek Sumsal [Thu, 6 Aug 2026 07:50:30 +0000 (09:50 +0200)] 
sd-journal: prefer machine ID from the tail entry

compare_boot_ids() (from 262299dccbb09f36c8c830dabd6a104469d9852b) skips
the tail entry realtime timestamp ordering when the compared locations
are from two different machines (and hence have two different machine
IDs) - in that case we fall through to a realtime comparison between the
two locations. This works fine except for journals that were imported
via systemd-journal-remote - the machine ID in the journal header is set
to the receiving machine's ID instead of the original one; but the
original machine ID is kept in the _MACHINE_ID= field.

This, however, defeats the check in compare_boot_ids() so we treat the
remote journals as local ones and try to compare the boots based on
their tail entry realtime timestamps, which results in grouping the
entries by their boot ID instead of interleaving them by their realtime
timestamp.

Given that we (transitively) call journal_file_read_tail_timestamp()
from compare_boot_ids(), where we both (re)set the newest_machine_id
field to the machine ID from the journal header and have the tail entry
at hand, let's try to get the _MACHINE_ID= field from the tail entry and
set newest_machine_id to that if it's present and valid. This way
compare_boot_ids() will correctly determine that the entries are from
two different machines and compare_locations() eventually falls through
to the entry realtime check, so we end up with properly interleaved
entries instead of entries grouped by boot ID.

The performance impact should be pretty negligible in vast majority of
cases, as we'd do this only when:
  - opening a new file
  - comparing entries across different boots
  - advancing to a next location

The first case is a one-time thing only per journal. The second and
third case might call this a bit more frequently, but we fall through to
the _MACHINE_ID= parsing only if the journal file got a new entry since
the last check. The most significant impact would be on journals that
are being actively written into, but even then iterating through the
handful of typical fields is negligible compared to what the rest of the
function does. Also, since 8f8ab4bf98f930fcbbdd7efcbba8577981d31df9 the
journal_file_read_tail_timestamp() calls are ratelimited when walking
through the journal, lessening the impact even further.

Resolves: #34169

2 days agoman: fix typos in systemd.scope.xml
gpenz [Fri, 7 Aug 2026 16:35:02 +0000 (18:35 +0200)] 
man: fix typos in systemd.scope.xml

2 days agotest/units: add missing -m 0700 to mkdir of root/.ssh
Jan Macku [Fri, 7 Aug 2026 12:50:28 +0000 (14:50 +0200)] 
test/units: add missing -m 0700 to mkdir of root/.ssh

mkdir without -m treats 0700 as another directory name argument.

Follow-up to https://github.com/systemd/systemd/commit/52d863defcd05d0b676ce743b9eaf1060131f9a1

2 days agoman: mention openat2 effect of RestrictSUIDSGID
dongshengyuan [Fri, 7 Aug 2026 05:37:51 +0000 (13:37 +0800)] 
man: mention openat2 effect of RestrictSUIDSGID

RestrictSUIDSGID uses seccomp to block setting SUID/SGID bits.
openat2() passes these mode bits indirectly via struct open_how.
Document that such calls are blocked regardless of requested mode.

Closes #43314

2 days agoTEST-92-TPM2-SWTPM: set a higher priority
Yu Watanabe [Thu, 6 Aug 2026 15:07:24 +0000 (00:07 +0900)] 
TEST-92-TPM2-SWTPM: set a higher priority

TEST-92-TPM2-SWTPM requires about 15 minutes on GitHub,
if it starts at the very end, the total CI run simply waits for
the test finished, and wastes the last 15 minutes.
Starting earlier should slightly improve the performance.

2 days agobootctl: also print .uname if present
Luca Boccassi [Thu, 6 Aug 2026 19:16:59 +0000 (20:16 +0100)] 
bootctl: also print .uname if present

A UKI might have a version from .osrelease which is not tied to the
kernel version. Pretty print the .uname section too, if present.

         type: Boot Loader Specification Type #2 (UKI, .efi)
        title: Debian GNU/Linux 13 (trixie) (34.186) (selected)
           id: debian-trixie_34.186_x86-64.efi
       source: /boot/efi//EFI/Linux/debian-trixie_34.186_x86-64.efi (on the EFI System Partition)
     sort-key: debian-trixie
      version: 34.186
        uname: 6.12.100+deb13-amd64
        linux: /boot/efi//EFI/Linux/debian-trixie_34.186_x86-64.efi
      profile: 0

2 days agohwdb: Make Apple DebugUSB work out-of-box
Davide Cavalca [Thu, 6 Aug 2026 20:54:29 +0000 (13:54 -0700)] 
hwdb: Make Apple DebugUSB work out-of-box

3 days agocore/service: Prevent accidental service termination during reload (#39692)
Yu Watanabe [Thu, 6 Aug 2026 16:23:03 +0000 (01:23 +0900)] 
core/service: Prevent accidental service termination during reload (#39692)

We currently blindly send the configured reload signal (e.g. SIGHUP or
SIGUSR1) to the main service PID for Type=notify-reload units, even if
the service hasn't installed a userspace handler. This can lead to
invoking unintended default behavior (typically process termination) in
daemons which later deprecate and remove their reload handler.

This is a real problem we have seen in production on multiple occasions.
In one particularly egregious instance, a production distributed storage
service had a large percentage of its nodes all terminate at once when
sent a reload signal. In this case a signal handler had been removed,
but another place still sending the signal was missed.

To mitigate this, introduce two new checks for Type=notify-reload
services:

1. On READY=1: When the service first sends READY=1 during initial
startup, we check for the handler. If it's missing, the service startup
is failed with SERVICE_FAILURE_PROTOCOL. This enforces the contract that
services *must* install their handler before signalling readiness.

2. On reload: Immediately before sending the reload signal, we check
again. If the handler is now missing, we log a warning but still send
the signal. This preserves the requested operator action while making
the missing handler visible.

The startup check catches definite static misconfiguration before the
service is accepted as ready. The reload check is advisory because the
service has already started successfully, but warns if its handler later
disappears. Together these provide a best-effort safety net while
preserving the agreed reload semantics.

3 days agobpf: probe generated vmlinux.h for LSM integrity types
dongshengyuan [Thu, 6 Aug 2026 05:39:33 +0000 (13:39 +0800)] 
bpf: probe generated vmlinux.h for LSM integrity types

Skip restrict-fsaccess when generated BTF lacks its LSM types.

Closes #42740

3 days agoanalyze: skip SVG-only plot metadata for text output
dongshengyuan [Thu, 6 Aug 2026 03:41:10 +0000 (11:41 +0800)] 
analyze: skip SVG-only plot metadata for text output

pretty_boot_time() and acquire_host_info() only feed the SVG header.
Do not query them when plot output is rendered as table or JSON.

Follow-up for ff46b2f97c42d73401ca3ffaaef54a017dc23923.

3 days agotest-kernel-install: tests for entry_name_format= 43290/head
Simon de Vlieger [Mon, 3 Aug 2026 17:34:27 +0000 (19:34 +0200)] 
test-kernel-install: tests for entry_name_format=

Test that custom entry_name_format=%e_%v produces correctly-named BLS
loader entries (the-token_1.1.4.conf) and UKI files (the-token_1.1.5.efi),
verifying that the full add/remove cycle works with the new entry name.

3 days agoman: entry_name_format=, KERNEL_INSTALL_ENTRY_NAME
Simon de Vlieger [Mon, 3 Aug 2026 16:49:09 +0000 (18:49 +0200)] 
man: entry_name_format=, KERNEL_INSTALL_ENTRY_NAME

Document the new entry_name_format= setting in install.conf and the
KERNEL_INSTALL_ENTRY_NAME / KERNEL_INSTALL_ENTRY_NAME_FORMAT environment
variables set for plugins.

List the available specifiers: %e (entry token), %v (kernel version),
%a (architecture), %A (IMAGE_VERSION), %M (IMAGE_ID), and all common
system specifiers.

3 days ago90-loaderentry: use KERNEL_INSTALL_ENTRY_NAME
Simon de Vlieger [Mon, 3 Aug 2026 16:47:54 +0000 (18:47 +0200)] 
90-loaderentry: use KERNEL_INSTALL_ENTRY_NAME

Replace the hardcoded $ENTRY_TOKEN-$KERNEL_VERSION pattern with
$KERNEL_INSTALL_ENTRY_NAME for the BLS Type#1 loader entry filename.
Falls back to $ENTRY_TOKEN-$KERNEL_VERSION when the variable is not set.

3 days ago90-uki-copy: use KERNEL_INSTALL_ENTRY_NAME
Simon de Vlieger [Mon, 3 Aug 2026 16:47:18 +0000 (18:47 +0200)] 
90-uki-copy: use KERNEL_INSTALL_ENTRY_NAME

Replace the hardcoded $ENTRY_TOKEN-$KERNEL_VERSION pattern with
$KERNEL_INSTALL_ENTRY_NAME, which is resolved by kernel-install from the
entry_name_format= setting. Falls back to $ENTRY_TOKEN-$KERNEL_VERSION
when the variable is not set, for compatibility with older kernel-install.

3 days agokernel-install: entry_name_format= support
Simon de Vlieger [Mon, 3 Aug 2026 16:46:09 +0000 (18:46 +0200)] 
kernel-install: entry_name_format= support

Read entry_name_format= from install.conf (or KERNEL_INSTALL_ENTRY_NAME_FORMAT
env var) and resolve it using specifier_printf() to produce a configurable entry
name. The resolved name is exported as KERNEL_INSTALL_ENTRY_NAME for plugins.

Override specifiers:
  %e - entry token
  %m - machine ID (kernel-install's resolved machine ID)
  %v - kernel version being installed (overrides standard %v)

All COMMON_SYSTEM_SPECIFIERS are also available (%a for architecture, %A for
IMAGE_VERSION, %M for IMAGE_ID, etc.).

Default format is "%e-%v", preserving the existing $ENTRY_TOKEN-$KERNEL_VERSION
behavior.

3 days agokernel-config: entry_name_format in install.conf
Simon de Vlieger [Mon, 3 Aug 2026 16:12:06 +0000 (18:12 +0200)] 
kernel-config: entry_name_format in install.conf

Extend load_kernel_install_conf_at() to parse the new entry_name_format=
setting from install.conf. This plumbing only, no behavioral change yet.
Existing callers pass NULL for the new parameter.

The entry_name_format= setting will allow configuring the boot entry
filename format using specifiers, replacing the current hardcoded
$ENTRY_TOKEN-$KERNEL_VERSION pattern. This is useful for image-based OS
builds (e.g. via mkosi, or image-builder) that require versioned UKI
filenames in the ESP for sysupdate A/B updates.

Having this configuration option allows to do that directly at build
time without having to side-step kernel-install and moving files around
manually.

3 days agosysupdate: fix transfer config parsing and cleanup regressions (#43287)
Yu Watanabe [Thu, 6 Aug 2026 11:20:29 +0000 (20:20 +0900)] 
sysupdate: fix transfer config parsing and cleanup regressions (#43287)

3 days agoshell-completion: add updatectl completions
dongshengyuan [Thu, 6 Aug 2026 02:39:55 +0000 (10:39 +0800)] 
shell-completion: add updatectl completions

Add bash and zsh completions for updatectl commands and options.
Complete targets and host features dynamically from updatectl output.

Closes #43277

4 days agosysupdate: allow long CurrentSymlink= paths 43287/head
dongshengyuan [Wed, 5 Aug 2026 04:18:03 +0000 (12:18 +0800)] 
sysupdate: allow long CurrentSymlink= paths

CurrentSymlink= accepts a symlink path, but the parser used NAME_MAX
for specifier expansion. Absolute and target-relative paths can be
longer than one filename component while still staying below PATH_MAX.

Reproducer: configure CurrentSymlink= to a path longer than NAME_MAX
and run systemd-sysupdate list with debug logging.

Before: sysupdate logged that CurrentSymlink= specifier expansion
failed and ignored the setting.

After: the transfer parses cleanly and list emits no CurrentSymlink=
specifier expansion warning.

Follow-up for: 43cc7a3ef4f6a89946e7ffd6a3112a0c1740b1ef

4 days agosysupdate: allow long metadata URLs
dongshengyuan [Wed, 5 Aug 2026 04:17:40 +0000 (12:17 +0800)] 
sysupdate: allow long metadata URLs

138829b784 moved Documentation=, AppStream=, and related URL parsing
into sysupdate-config.c, but kept NAME_MAX as the specifier expansion
limit. These settings are URLs, not filenames.

Reproducer: configure a feature Documentation= URL longer than
NAME_MAX and run systemd-sysupdate features FEATURE.

Before: the URL was ignored after ENAMETOOLONG during specifier
expansion.

After: features FEATURE prints the long Documentation URL.

Follow-up for: 138829b7843c6f744764d72d2c995005bfe6dc00

4 days agosysupdate: allow resetting version filters
dongshengyuan [Wed, 5 Aug 2026 04:17:10 +0000 (12:17 +0800)] 
sysupdate: allow resetting version filters

systemd drop-ins use an empty assignment to reset list and scalar
settings. MinVersion= and ProtectVersion= treated an empty assignment
as an invalid version and kept the earlier value active.

Reproducer: define MinVersion=v2 and ProtectVersion=v1, then add a
drop-in with empty MinVersion= and ProtectVersion= assignments.

Before: sysupdate logged invalid-version warnings for the empty values.

After: list logs no invalid-version warnings and shows both v1 and v2.

Follow-up for: 43cc7a3ef4f6a89946e7ffd6a3112a0c1740b1ef

4 days agosysupdate: parse PartitionFlags= as hexadecimal
dongshengyuan [Wed, 5 Aug 2026 04:16:38 +0000 (12:16 +0800)] 
sysupdate: parse PartitionFlags= as hexadecimal

sysupdate.d(5) documents PartitionFlags= as a hexadecimal integer, and
sysupdate patterns format partition flags with PRIx64. The parser used
safe_atou64(), which rejected values such as abcdef.

Reproducer: set PartitionFlags=abcdef in a partition target transfer
and run systemd-sysupdate list with debug logging.

Before: sysupdate logged:
Failed to parse partition flags, ignoring: abcdef

After: the transfer parses cleanly and list emits no partition-flags
parse warning.

Follow-up for: 43cc7a3ef4f6a89946e7ffd6a3112a0c1740b1ef

4 days agosysupdate: remove current partial instance names
dongshengyuan [Wed, 5 Aug 2026 08:01:46 +0000 (16:01 +0800)] 
sysupdate: remove current partial instance names

48fff6a27a switched filesystem transfers to predictable
.sysupdate.partial.* names, but transfer_remove_temporary()
still only scanned the legacy .# prefix.

Remove the current partial prefix there too. Pending instances
are deliberately left for transfer_vacuum(), so ProtectVersion=
can still spare protected pending versions.

Follow-up for: 48fff6a27aab434035d5ead65d48a6f860f5b656

4 days agosysupdate: honor default MatchPartitionType= for partitions
dongshengyuan [Wed, 5 Aug 2026 04:15:19 +0000 (12:15 +0800)] 
sysupdate: honor default MatchPartitionType= for partitions

sysupdate.d(5) documents linux-generic as the default
MatchPartitionType= for partition targets. After 10eaca4159,
omitting the option left partition_type_set false and update failed
before acquiring the image.

Reproducer: create a partition target transfer without
MatchPartitionType= and run systemd-sysupdate update.

Before: update failed with:
Partition type must be set for partition targets.

After: update succeeds on a linux-generic slot and installs the
version, leaving the GPT label as part-v1.

Follow-up for: 10eaca4159a93485054c4e7c7c35ce16114591d7

4 days agoTEST-80-NOTIFYACCESS: Add notify-reload signal handler validation test 39692/head
Chris Down [Wed, 12 Nov 2025 08:59:05 +0000 (16:59 +0800)] 
TEST-80-NOTIFYACCESS: Add notify-reload signal handler validation test

Add a new integration test to verify the signal handler validation for
Type=notify-reload services, as introduced in the previous commit.

The test adds a shell harness and four service files to cover all scenarios:

1. `notify-reload-no-handler.service`: Verifies that the service fails to
   start with Result=protocol when the handler is missing at the first
   READY=1.

2. `notify-reload-sigstop.service`: Verifies that SIGSTOP is exempt from
   handler validation because it cannot be caught or blocked.

3. `notify-reload-toggle-handler.service`: Verifies that removing the
   handler at runtime results in a warning on reload, but the signal is still
   sent, causing the service to terminate from unhandled SIGHUP.

4. `notify-reload-well-behaved.service`: Verifies the happy path where a
   service with a handler starts and reloads successfully.

Use bounded FIFO operations and journal cursors so failures are prompt and log
assertions cannot race a relative time window.

4 days agohwdb: Add HP EliteBook 845 G7 Fn+F11 airplane mode key mapping
rodin-ia [Wed, 5 Aug 2026 21:53:08 +0000 (00:53 +0300)] 
hwdb: Add HP EliteBook 845 G7 Fn+F11 airplane mode key mapping

Add a hwdb entry for the HP EliteBook 845 G7 laptop.

The Fn+F11 airplane mode key is reported as KEY_F8 by the atkbd
driver. Map it to !wlan to expose the correct wireless radio switch
event to userspace.

4 days agosd-journal: prefer exact cursor match after seek (#43297)
Yu Watanabe [Wed, 5 Aug 2026 20:48:05 +0000 (05:48 +0900)] 
sd-journal: prefer exact cursor match after seek (#43297)

Fixes #31516.

4 days agosysctl: add --verify option to verify written values (#43258)
Yu Watanabe [Wed, 5 Aug 2026 20:46:11 +0000 (05:46 +0900)] 
sysctl: add --verify option to verify written values (#43258)

4 days agoRevert "ci: fix /etc and /usr ownership"
Frantisek Sumsal [Wed, 5 Aug 2026 20:09:53 +0000 (22:09 +0200)] 
Revert "ci: fix /etc and /usr ownership"

The issue with the GHA images should be resolved.

This reverts commit 6d7a2ec6ba21184cac1cfd39fe50d0def23220f2.

4 days agohwdb: Add accelerometer matrix for SHIFTbook 1
Thomas Kopp [Wed, 5 Aug 2026 19:06:56 +0000 (21:06 +0200)] 
hwdb: Add accelerometer matrix for SHIFTbook 1

Fixes autorotation on the SHIFTbook 1

4 days agoman: fix seven cross-references with the wrong section number
Hüseyin Kutsi Balcı [Wed, 5 Aug 2026 19:03:12 +0000 (22:03 +0300)] 
man: fix seven cross-references with the wrong section number

Each of these citerefentry targets exists, but is referenced with a
section it is not installed in, so the generated link does not resolve
and 'man <page>' sends the reader to the wrong section.

  systemd-confext              1 -> 8
  systemd-cryptsetup@.service  5 -> 8
  systemd-firstboot.service    8 -> 1  (three places)
  systemd-nspawn               8 -> 1
  systemd-userdbd.service      7 -> 8

The section for each was taken from the refmeta of the page that
defines it. In systemd.special.xml the neighbouring reference to
systemd-veritysetup@.service already uses 8, which is what the
cryptsetup one should have been.

4 days agohwdb: mark ASUS ROG Flow Z13 (GZ302EA) touchpad as internal
Confusedphoton [Wed, 5 Aug 2026 16:47:15 +0000 (12:47 -0400)] 
hwdb: mark ASUS ROG Flow Z13 (GZ302EA) touchpad as internal

The ASUS ROG Flow Z13 (GZ302EA) keyboard/touchpad (USB 0B05:1A30) is
attached through a USB port that firmware reports as removable.
Because of that, 65-integration.rules sets
ID_INPUT_TOUCHPAD_INTEGRATION=external, and libinput skips
disable-while-typing (DWT) for the device.

The touchpad is physically integrated into the tablet's keyboard
accessory, which has no supported standalone/external use case, so
add a hwdb entry in 70-touchpad.hwdb that overrides
ID_INPUT_TOUCHPAD_INTEGRATION=internal, restoring DWT. This mirrors
the existing Microsoft Surface Type Cover entry, which addresses the
same root cause.

4 days agotest: verify cursor-seeking in the opposite direction as well 43297/head
Frantisek Sumsal [Wed, 5 Aug 2026 16:33:17 +0000 (18:33 +0200)] 
test: verify cursor-seeking in the opposite direction as well

4 days agosd-journal: prefer exact cursor match after seek
Frantisek Sumsal [Wed, 5 Aug 2026 14:46:13 +0000 (16:46 +0200)] 
sd-journal: prefer exact cursor match after seek

Since 262299dccbb09f36c8c830dabd6a104469d9852b compare_locations() falls
through to a realtime-based comparison in compare_boot_ids() if the
compared entries have different boot IDs (and seqnum IDs). This can,
however, cause us to pick up the wrong entry/file on systems with
unreliable/missing RTC, where early-boot entries of a boot might have
earlier realtime timestamp compared to the previous boot.

For example, here's a minimal reproducer consisting of two journal files
containing three entries from two separate boot IDs:

$ journalctl --file one.journal -o export
__CURSOR=s=ba37c62fcacf406aad088166c4963cd1;i=1;b=c220efc91dd440deb89d82c98ddb11a5;m=186a0;t=1e8480;x=39d4323a8e5a248d
__REALTIME_TIMESTAMP=2000000
__MONOTONIC_TIMESTAMP=100000
__SEQNUM=1
__SEQNUM_ID=ba37c62fcacf406aad088166c4963cd1
_BOOT_ID=c220efc91dd440deb89d82c98ddb11a5
NUMBER=1

$ journalctl --file two.journal -o export
__CURSOR=s=9d15197efcc54d8ca5d6e7cce28373e2;i=1;b=686dc35e78f64b6ba126018ab6e8bae9;m=186a0;t=f4240;x=57db1c7bd38b37ed
__REALTIME_TIMESTAMP=1000000
__MONOTONIC_TIMESTAMP=100000
__SEQNUM=1
__SEQNUM_ID=9d15197efcc54d8ca5d6e7cce28373e2
_BOOT_ID=686dc35e78f64b6ba126018ab6e8bae9
NUMBER=2

__CURSOR=s=9d15197efcc54d8ca5d6e7cce28373e2;i=2;b=686dc35e78f64b6ba126018ab6e8bae9;m=30d40;t=2dc6c0;x=3513732159948113
__REALTIME_TIMESTAMP=3000000
__MONOTONIC_TIMESTAMP=200000
__SEQNUM=2
__SEQNUM_ID=9d15197efcc54d8ca5d6e7cce28373e2
_BOOT_ID=686dc35e78f64b6ba126018ab6e8bae9
NUMBER=3

The first file (one.journal) contains a single entry from the first boot
(c220efc91dd440deb89d82c98ddb11a5) and a realtime timestamp of 2s. The
second file (two.journal) contains two entries from the second boot
(686dc35e78f64b6ba126018ab6e8bae9) - the first entry has a realtime
timestamp of 1s (i.e. _earlier_ than the tail timestamp of the first
boot), and the second entry has a realtime timestamp of 3s (i.e.  after
a time correction).

This works fine for forward iteration, but seeking directly to the
second entry is when things go south:

First entry:
$ python3 <<EOF
c = "s=ba37c62fcacf406aad088166c4963cd1;i=1;b=c220efc91dd440deb89d82c98ddb11a5;m=186a0;t=1e8480;x=39d4323a8e5a248d"
from systemd import journal; j = journal.Reader(path="."); j.seek_cursor(c); j.get_next(); print(j.test_cursor(c))
EOF
True

Second entry:
$ python3 <<EOF
c = "s=9d15197efcc54d8ca5d6e7cce28373e2;i=1;b=686dc35e78f64b6ba126018ab6e8bae9;m=186a0;t=f4240;x=57db1c7bd38b37ed"
from systemd import journal; j = journal.Reader(path="."); j.seek_cursor(c); j.get_next(); print(j.test_cursor(c))
EOF
False

That's because:
  - we call sd_journal_seek_cursor(...) and parse it (seqnum, seqnum_id,
    boot_id, realtime, ...)
  - we call sd_journal_next() -> real_journal_next() which iterates over
    all open journal files to find all candidate entries and pick the
    best one
  - for each journal file we call next_beyond_location()
  - for next_beyond_location(one.journal) we get:
    - last_direction is _DIRECTION_INVALID, so we call find_location_with_matches()
    - we fall all the way through to journal_file_move_to_entry_by_realtime()
    - here we try to find the first entry with realtime >= 1s; this file
      has only one entry with realtime = 2s which matches
  - we got a match and new_file is unset, so we set it to one.journal
  - for next_beyond_location(two.journal) we get:
    - we fall through to find_location_with_matches()
    - here we have a matching seqnum, so we call journal_file_move_to_entry_by_seqnum()
  - we got another match but new_file is set, so we call compare_locations(two.journal, one.journal):
    - we fall through to compare_boot_ids()
    - we get the tail timestamps of both journal files and return
      CMP(second boot, first boot) -> CMP(3s, 2s) = 1
  - this bubbles up back to real_journal_next() where found = false, so
    new_file remains one.journal (the wrong journal file)
  - this is followed by set_location(one.journal), which makes the
    following sd_journal_test_cursor() call fail, as the
    boot_id/seqnum_id/... of the current position don't match with the
    cursor

To fix this, let's track the journal file that holds the exact cursor
match, and override the chosen candidate if needed once we process all
open journals.

Resolves: #31516

4 days agoman: clarify enqueue-marked uses try-restart semantics
Hashim Khan [Fri, 31 Jul 2026 18:09:56 +0000 (23:09 +0500)] 
man: clarify enqueue-marked uses try-restart semantics

Document that needs-restart/needs-reload markers follow try-restart /
try-reload behavior for enqueue-marked, and drop the duplicated note
from the deprecated --marked alias entry.

4 days agorepart: fix shallow_join_strv() dedup scan
dongshengyuan [Wed, 5 Aug 2026 06:23:19 +0000 (14:23 +0800)] 
repart: fix shallow_join_strv() dedup scan

shallow_join_strv() shallow-copies the first strv into a temporary
array, then uses strv_contains() while appending entries from the
second strv. That helper requires a NUL-terminated strv.

Keep the temporary array terminated before each lookup. After an
append, the previous terminator is overwritten, so postponing the
NULL write until after the loop would let the next strv_contains()
scan past the initialized entries.

This is a correctness fix, not an optimization: it avoids a
potential out-of-bounds read when deduplicating the second strv.

4 days agosd-netlink: append multipart messages in O(1)
dongshengyuan [Wed, 5 Aug 2026 07:54:25 +0000 (15:54 +0800)] 
sd-netlink: append multipart messages in O(1)

Commit 52ceba53d3 made multipart replies append in receive
order, but each append walked the chain from the head.

Cache the tail on the chain head, so new fragments can be
linked directly. The visible next-pointer chain and order stay
unchanged.

Follow-up for: 52ceba53d3ccd3b57dcb795612de7886aaf928ca

4 days agodbus: allow FreezeUnit and ThawUnit D-Bus requests (#43292)
Semyon Klintsov [Wed, 5 Aug 2026 08:33:48 +0000 (11:33 +0300)] 
dbus: allow FreezeUnit and ThawUnit D-Bus requests (#43292)

This change adds explicit D-Bus policy rules to allow calling the
Freeze and Thaw methods on the systemd interfaces.

- Add D-Bus policy rules for Manager interface FreezeUnit/ThawUnit methods
- Add D-Bus policy rules for Unit interface Freeze/Thaw methods

4 days agoman: clarify that --fido2-with-user-presence= may not be supported (#43266)
lzwind [Wed, 5 Aug 2026 07:59:47 +0000 (15:59 +0800)] 
man: clarify that --fido2-with-user-presence= may not be supported (#43266)

Reword the note for --fido2-with-user-presence= to make it clear that the
setting has no effect if the token does not support the up feature, or does
not allow the user presence requirement to be enabled or disabled for the
requested operation. Drop the surrounding parentheses and the spurious
"in other contexts" qualifier.

Apply the same rewording to the sibling --fido2-with-client-pin= and
--fido2-with-user-verification= options so the three parallel FIDO2
entries stay consistent.

Fixes #23632.

5 days agopcrlock: error out if requested PCR was dropped (#43260)
Yu Watanabe [Wed, 5 Aug 2026 04:17:21 +0000 (13:17 +0900)] 
pcrlock: error out if requested PCR was dropped (#43260)

- --strict=/--full moved to the OPTION_LONG() parser framework that
replaced getopt in the meantime
- the is-supported commit is dropped, main grew that verb independently.
That also gets rid of the early tpm2_support() gate that broke CI back
then, and TEST-70-TPM2 runs with a software TPM these days anyway
- special_glyph() → glyph() renames
- the log table PCR filter needs an EVENT_LOG_RECORD_IS_PCR() guard now
that the event log has NV-index records

5 days agoman: mention userdb.transient.* credentials in userdbctl(1)
Yu Watanabe [Tue, 4 Aug 2026 16:53:39 +0000 (01:53 +0900)] 
man: mention userdb.transient.* credentials in userdbctl(1)

These were only explained in systemd.system-credentials(7).
Let's also list them in userdbctl(1).

Follow-up for cc43510a139bd3002768c89c2d233158aaf418ca.

5 days agotest: split out inline python script
Yu Watanabe [Tue, 4 Aug 2026 16:36:19 +0000 (01:36 +0900)] 
test: split out inline python script

Then, we can apply ruff to the script.

5 days agocore/service: Prevent accidental service termination during reload
Chris Down [Wed, 12 Nov 2025 07:22:28 +0000 (15:22 +0800)] 
core/service: Prevent accidental service termination during reload

We currently blindly send the configured reload signal (e.g. SIGHUP or
SIGUSR1) to the main service PID for Type=notify-reload units, even if
the service hasn't installed a userspace handler. This can lead to
invoking unintended default behavior (typically process termination) in
daemons which later deprecate and remove their reload handler.

This is a real problem we have seen in production on multiple occasions.
In one particularly egregious instance, a production distributed storage
service had a large percentage of its nodes all terminate at once when
sent a reload signal. In this case a signal handler had been removed, but
another place still sending the signal was missed.

To mitigate this, introduce signal handler validation for
Type=notify-reload services. We check both SigCgt (traditional handlers
via sigaction) and SigBlk (blocked signals for signalfd) to detect valid
handler configurations:

1. On first READY=1: When the service first sends READY=1 during initial
   startup, we check for the handler. If it's missing, the service
   startup is aborted with Result=protocol.

2. On reload: Immediately before sending the reload signal, we check
   again. If the handler is missing, we log a warning but still send
   the signal.

The rationale is that a missing handler at first startup represents a
definite misconfiguration that should be caught early. A missing handler
at reload time is warned about, but we defer to the operator's judgement
since the service already started successfully.

These checks are a best-effort, pragmatic safety net. They are naturally
racy, but in practice they prevent the common class of bugs from static
misconfiguration or software updates.

5 days agoprocess-util: Add helpers to check for signal handler presence
Chris Down [Wed, 12 Nov 2025 08:57:58 +0000 (16:57 +0800)] 
process-util: Add helpers to check for signal handler presence

Add new pidref_has_sigcgt() and pidref_has_sigblk() helpers. These read
the SigCgt and SigBlk bitmasks from /proc/<pid>/status to detect either
traditional signal handlers installed via sigaction(2), or blocked signals
that are typically handled via signalfd(2), such as through
sd_event_add_signal().

Both mechanisms represent valid ways to handle a signal without invoking
the default action. Share the parsing and pidref verification between the
two public helpers.

5 days agopcrlock: skip make-policy tests if environment lacks TPM support 43260/head
Ludwig Nussel [Mon, 29 Apr 2024 12:34:25 +0000 (14:34 +0200)] 
pcrlock: skip make-policy tests if environment lacks TPM support

make-policy needs to write into an NVindex. For that we need an actual
TPM.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopcrlock: honor pcr arg for filtering list-components
Ludwig Nussel [Thu, 7 Mar 2024 14:43:22 +0000 (15:43 +0100)] 
pcrlock: honor pcr arg for filtering list-components

5 days agopcrlock: ignore empty device path
Ludwig Nussel [Thu, 7 Mar 2024 14:19:05 +0000 (15:19 +0100)] 
pcrlock: ignore empty device path

Don't mark records with empty device path as invalid. When shim is in
use such records are normal :-/
https://github.com/rhboot/shim/issues/642

5 days agopcrlock: reduce verbosity a bit
Ludwig Nussel [Thu, 29 Feb 2024 08:36:56 +0000 (09:36 +0100)] 
pcrlock: reduce verbosity a bit

Not sure what a good compromise between too much and too less is.
Semi happy with SYSTEMD_LOG_LEVEL=notice now.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopcrlock: limit list view to selected PCRs
Ludwig Nussel [Thu, 22 Feb 2024 14:06:57 +0000 (15:06 +0100)] 
pcrlock: limit list view to selected PCRs

Makes it easier to inspect specific PCRs

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopcrlock: add --strict option
Ludwig Nussel [Thu, 15 Feb 2024 16:59:53 +0000 (17:59 +0100)] 
pcrlock: add --strict option

Add a --strict option that makes sure all PCRs for which components were
found are indeed included in the set of predicted PCRs. Instead throw an
error. Avoids creating a policy less secure than requested.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopcrlock: don't add checkmark for missing component
Ludwig Nussel [Tue, 20 Feb 2024 16:55:05 +0000 (17:55 +0100)] 
pcrlock: don't add checkmark for missing component

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopcrlock: shorten displayed hash bytes
Ludwig Nussel [Thu, 15 Feb 2024 16:08:35 +0000 (17:08 +0100)] 
pcrlock: shorten displayed hash bytes

Shorten number of bytes show of sha256 hashes. Similar to git, makes
output less wide and more readable.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopcrlock: exclude red and green color ranges
Ludwig Nussel [Mon, 19 Feb 2024 17:19:48 +0000 (18:19 +0100)] 
pcrlock: exclude red and green color ranges

Using red and green in the output is rather confusing as that is
normally associated with good or bad like in the checkmark columns.
So let's exclude those colors from the display.

Co-authored-by: Akarithos <277667353+Akarithos@users.noreply.github.com>
5 days agopo: Translated using Weblate (Interlingua)
Emilio Sepulveda [Tue, 4 Aug 2026 16:18:49 +0000 (16:18 +0000)] 
po: Translated using Weblate (Interlingua)

Currently translated at 22.3% (64 of 286 strings)

Co-authored-by: Emilio Sepulveda <emism.translations@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ia/
Translation: systemd/main

5 days agopo: Translated using Weblate (Italian)
Weblate Translation Memory [Tue, 4 Aug 2026 16:18:49 +0000 (16:18 +0000)] 
po: Translated using Weblate (Italian)

Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Weblate Translation Memory <noreply-mt-weblate-translation-memory@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/it/
Translation: systemd/main

5 days agopo: Translated using Weblate (Italian)
Emanuele Petriglia [Tue, 4 Aug 2026 16:18:48 +0000 (16:18 +0000)] 
po: Translated using Weblate (Italian)

Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Emanuele Petriglia <inbox@emanuelepetriglia.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/it/
Translation: systemd/main

5 days agovmspawn: apply --grow-image= to the ephemeral copy
Daan De Meyer [Fri, 31 Jul 2026 19:13:12 +0000 (21:13 +0200)] 
vmspawn: apply --grow-image= to the ephemeral copy

Combining --ephemeral with --grow-image= truncated the file passed to
--image= to the requested size before the VM was started, so a mode whose
entire purpose is to leave the original image untouched modified it on
disk.

Skip growing the original image when running ephemeral, and instead create
the qcow2 overlay with the requested virtual size, so the guest sees the
larger disk while the base image stays read-only. As only the overlay is
sized in that case, the base image format no longer matters, so allow
--grow-image= together with qcow2 images when running ephemeral. The round
up to a multiple of 4096 moves to option parsing so both paths apply the
same value.

The vmspawn drive test grows an ephemeral VM and checks that the image
passed to --image= keeps its size, and that the overlay QEMU runs off is
created at the requested one.

5 days agouserdb: apply UUID filters to group records
dongshengyuan [Tue, 4 Aug 2026 01:58:17 +0000 (09:58 +0800)] 
userdb: apply UUID filters to group records

group_record_match() handled the other filters, but ignored match->uuid,
so userdbctl group --uuid=... could still return non-matching groups.

Add the same UUID check used by user_record_match().

Reproduced locally:
build/userdbctl --uuid=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa \
  --output=json group root

Before result:
The command succeeded and printed the root group record.

Follow-up for: 466562c69b75cec197176f556b940a43bb8350f2

5 days agoRevert "macro: EDG compiler frontends doesn't support enum types"
Luca Boccassi [Tue, 4 Aug 2026 11:45:29 +0000 (12:45 +0100)] 
Revert "macro: EDG compiler frontends doesn't support enum types"

The EDG parser version 6.8 now supports C23 enums with fixed underlying
types, and VSCode ships with it, so this workaround can now be removed
without breaking VSCode's internal parser.

https://en.cppreference.com/c/compiler_support/23

This reverts commit e01ca3afdb297fe879eaabd02901ad2a4b547d0c.

5 days agotest-nss-users: quote empty member lists
dongshengyuan [Tue, 4 Aug 2026 10:24:22 +0000 (18:24 +0800)] 
test-nss-users: quote empty member lists

Use shell_maybe_quote() with SHELL_ESCAPE_EMPTY when
logging joined group and shadow group member vectors,
so empty vectors are rendered explicitly as "".

Follow-up for: f0d1266821771724b09a00764f4e20478c77f0a2

Follow-up for: 2eaca3ea5f0de702382d388d3bbc753c000ada4b

5 days ago60-ukify: skip `/proc/cmdline` in containers
Simon de Vlieger [Mon, 3 Aug 2026 10:05:55 +0000 (12:05 +0200)] 
60-ukify: skip `/proc/cmdline` in containers

When running inside a container (during image builds or such),
`/proc/cmdline` belongs to the host and would leak the host's root= (or a
faked placeholder like root=/dev/osbuild) into the UKI.

Mirror the same guard that `90-loaderentry.install` has: check
`systemd-detect-virt --container` before falling back to `/proc/cmdline`,
and return an empty cmdline if we are in a container to ensure both
modes (`uki` and `bls`) work the same.

Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
5 days agooptions: use strv_join()
Yu Watanabe [Tue, 4 Aug 2026 07:14:25 +0000 (16:14 +0900)] 
options: use strv_join()

strv_join() is an alias of strv_join_full() with NULL for prefix and
false for escape_separator. Let's use the shorter form.

5 days agoenv-file: cleanups for write_env_file_label()
Yu Watanabe [Tue, 4 Aug 2026 01:12:05 +0000 (10:12 +0900)] 
env-file: cleanups for write_env_file_label()

Explicitly call label_ops_post() where necessary with specific
arguments. Previously, regardless if fopen_tmpfile_linkable_at()
success, label_ops_post() was called but its argument was heavily
conditionalized. Let's call it both on failure and success cases
with specific arguments. This should be easy to read.

This also
- moves variable declarations where used,
- drops unnecessary boolean flag call_label_ops_post.

No functional change. Just reafactoring.

Hopefully silence CID#1664328, though it is false-positive.

5 days agorepart: pass FileSystemSectorSize= to mkfs.erofs
Liu Zheng [Mon, 3 Aug 2026 07:30:00 +0000 (07:30 +0000)] 
repart: pass FileSystemSectorSize= to mkfs.erofs

The erofs branch in make_filesystem() never passed the sector size to
mkfs.erofs, so FileSystemSectorSize= was silently ignored for erofs
partitions. mkfs.erofs defaults to the page size (e.g. 16K on aarch64),
which is too large for some use cases such as UFS with 4K blocks.

Pass -b <sector_size> to mkfs.erofs, but only when it is smaller than the
page size, since mkfs.erofs defaults to the page size and rejects larger
values. This matches how the other supported filesystems (xfs, ext4,
btrfs, f2fs, vfat) already handle sector_size.

Fixes #43238

6 days agorepart: document implied CopyFiles= denylists
Liu Zheng [Fri, 31 Jul 2026 09:25:22 +0000 (09:25 +0000)] 
repart: document implied CopyFiles= denylists

systemd-repart implicitly excludes the contents of APIVFS and temporary
directories (/proc, /sys, /dev, /tmp, /run, /var/tmp) when copying files
via CopyFiles=. When populating a root partition, the contents below the
mount points of other partitions in the image (e.g. /boot, /efi for an
esp partition) are excluded as well, so that data belonging to a separate
partition is not duplicated into the root file system.

Neither of these implied denylists was documented, which surprised users
(see #32651). Document them, and explain how to work around the
mount-point exclusion by adding an explicit CopyFiles= entry for the
directory in question.

Fixes #32651

6 days agosysusers: gracefully handle existing group in /etc/gshadow
Frantisek Sumsal [Mon, 3 Aug 2026 13:34:15 +0000 (15:34 +0200)] 
sysusers: gracefully handle existing group in /etc/gshadow

systemd-sysusers currently skips entries for groups that already exists.
However, if a group exists only in /etc/gshadow and not in /etc/group,
systemd-sysusers panics:

~# groupdel sgx
~# systemd-sysusers; echo $?
Creating group 'sgx' with GID 106.
0
~# systemd-sysusers; echo $?
0
~# sed -i '/sgx/d' /etc/group
~# systemd-sysusers; echo $?
Creating group 'sgx' with GID 106.
/etc/gshadow: Group "sgx" already exists.
1

To fix this, let's mirror the logic from the user path
(write_temporary_shadow()) where we simply drop the user from the "todo"
queue if it already exists in /etc/shadow instead of throwing an error.

6 days agocore/bpf: avoid redundant BPF program loading (#43234)
Yu Watanabe [Mon, 3 Aug 2026 23:10:00 +0000 (08:10 +0900)] 
core/bpf: avoid redundant BPF program loading (#43234)

Replaces #43211 and #43213.

6 days agoresolvectl: support JSON output for openpgp and tlsa
dongshengyuan [Sun, 2 Aug 2026 08:52:50 +0000 (16:52 +0800)] 
resolvectl: support JSON output for openpgp and tlsa

The openpgp and tlsa verbs rejected --json= even though they
already determine the RR type they query. Allow JSON output for
these shortcut commands.

Accept matching explicit --type= values as well, but reject
mismatched types so openpgp only queries OPENPGPKEY records and
tlsa only queries TLSA records.

Refuse unauthenticated key records in JSON format so scripts do
not accidentally consume cryptographic DNS data that would only
produce a warning in human-readable output.

Fixes #43245

6 days agodocs: fix typo in man/sd-device.xml
Shivank Sharma [Mon, 3 Aug 2026 15:22:01 +0000 (20:52 +0530)] 
docs: fix typo in man/sd-device.xml

Fix spelling of "managed" in man/sd-device.xml.

6 days agoAdd ActivatingConcurrencyMax for slice startup pacing
Morteza Pourkazemi [Sun, 26 Jul 2026 22:38:11 +0000 (00:38 +0200)] 
Add ActivatingConcurrencyMax for slice startup pacing

Introduce Slice.ActivatingConcurrencyMax to limit how many units
within a slice hierarchy may be in activating state concurrently.

Expose the setting over D-Bus, support transient/property parsing,
enforce it during unit start dispatch, and re-check queued starts when
units leave activating state.

Document the new slice option and add a PID1 concurrency test covering
queued startup behavior.

6 days agosysctl: add --verify option to verify sysctl values after write 43258/head
Yu Watanabe [Sun, 2 Aug 2026 19:07:41 +0000 (04:07 +0900)] 
sysctl: add --verify option to verify sysctl values after write

This may be useful, e.g. when writing coredump pattern.

6 days agosysctl-util: introduce sysctl_write_verify()
Yu Watanabe [Sun, 2 Aug 2026 16:20:48 +0000 (01:20 +0900)] 
sysctl-util: introduce sysctl_write_verify()

This is useful when writing coredump pattern. But the logic itself is
quite generic. Let's add the helper in our basic library.
Preparation for later change.

6 days agosysctl: setup logging earlier
Yu Watanabe [Sun, 2 Aug 2026 15:31:53 +0000 (00:31 +0900)] 
sysctl: setup logging earlier

As parse_argv() may log something.

6 days agoman: systemd-sysctl --strict does not take any arguments
Yu Watanabe [Sun, 2 Aug 2026 19:19:27 +0000 (04:19 +0900)] 
man: systemd-sysctl --strict does not take any arguments

This also drops unused ids.

6 days agoudev: derive path ID for PNP devices from ACPI firmware node
Andre Eikmeyer [Sun, 2 Aug 2026 13:48:41 +0000 (15:48 +0200)] 
udev: derive path ID for PNP devices from ACPI firmware node

PNP devices may represent ACPI-enumerated hardware but do not have a
parent type supported by path_id. Consequently, importing path_id fails
even when the PNP device exposes a stable ACPI firmware_node. This also
prevents later assignments in rules such as the systemd-backlight
activation rule from taking effect.

Resolve the PNP device's firmware_node and use its ACPI sysname for the
path component. This gives PNP-backed devices the same stable identity
as their firmware representation.

Add a regression test using an RTC device below a PNP parent with an
ACPI firmware node.

6 days agobus: Reduce sd_bus_message size by 9.9% by dropping offset bookkeeping
Chris Down [Sun, 2 Aug 2026 22:43:20 +0000 (15:43 -0700)] 
bus: Reduce sd_bus_message size by 9.9% by dropping offset bookkeeping

sd_bus_message carries an array of header field offsets and a counter,
but their only reader was part of the D-Bus v2/GVariant sealing path
removed in 0dd487681505 ("sd-bus: drop D-Bus version 2 format support").

There are three remaining callers of message_extend_fields(), for
SD_BUS_MESSAGE_HEADER_DESTINATION, _PATH, and _INTERFACE, and all of
them pass false for add_offset. The receive path does not populate the
array either, so nothing reads or writes it any more.

Let's drop the two fields and the now unused add_offset argument and
branch.

This reduces sizeof(sd_bus_message) from 792...

    $ gdb -batch build-baseline/test-bus-benchmark \
          -ex 'ptype /o struct sd_bus_message'
                              ...
                              /* 688 |     8 */ usec_t timeout;
                              /* 696 |    80 */ size_t header_offsets[10];
                              /* 776 |     4 */ unsigned int n_header_offsets;
                              /* XXX  4-byte hole */
                              /* 784 |     8 */ uint64_t read_counter;
                              /* total size (bytes):  792 */

to 704 bytes:

    $ gdb -batch build-patched/test-bus-benchmark \
          -ex 'ptype /o struct sd_bus_message'
                              ...
                              /* 688 |     8 */ usec_t timeout;
                              /* 696 |     8 */ uint64_t read_counter;
                              /* total size (bytes):  704 */

On Fedora 43 aarch64 with glibc 2.42, the usable allocation for a
method-call message falls from 808 to 728 bytes, a reduction of 9.9%.

In my tests, retaining 400,000 method-call messages reduces in median
peak RSS from 363M to 332M.

Using `test-bus-benchmark chart direct 500ms` across message sizes from
1 byte to 2 MiB one can also see things are around 1% faster, which is
another nice incidental boost.

6 days agohwdb: fix Lenovo B570e touchpad ABS ranges for edge scrolling (#43264)
lzwind [Mon, 3 Aug 2026 04:43:45 +0000 (12:43 +0800)] 
hwdb: fix Lenovo B570e touchpad ABS ranges for edge scrolling (#43264)

The Lenovo B570e touchpad (ETPS/2 Elantech) reports ABS ranges that
are too wide by default, which makes edge scrolling trigger across
roughly the right half of the touchpad instead of only at the right
edge. Add an evdev hwdb entry in `60-evdev.hwdb` that overrides the
ABS_X/ABS_Y (and the matching MT position) ranges with the calibrated
values, following the same pattern already used for the Lenovo B590
and L430 entries.

Fixes #29666

6 days agohwdb: mark Adesso wireless keyboard trackball as trackball (#43263)
lzwind [Mon, 3 Aug 2026 04:42:13 +0000 (12:42 +0800)] 
hwdb: mark Adesso wireless keyboard trackball as trackball (#43263)

The Adesso wireless keyboard with an integrated trackball (MosArt
062a:4101) is identified as a regular mouse, so trackball-style
scrolling does not work out of the box. Add a hwdb entry in
`70-mouse.hwdb` setting `ID_INPUT_TRACKBALL=1` so libinput and other
clients treat the device as a trackball.

Fixes #29609

6 days agohwdb: mark Microsoft Surface Type Cover touchpad as internal (#43262)
lzwind [Mon, 3 Aug 2026 04:41:02 +0000 (12:41 +0800)] 
hwdb: mark Microsoft Surface Type Cover touchpad as internal (#43262)

The Microsoft Surface Type Cover touchpad (USB 045E:09C0) is attached
through a USB port that firmware reports as removable. Because of that,
`65-integration.rules` sets `ID_INPUT_TOUCHPAD_INTEGRATION=external`,
and libinput skips disable-while-typing (DWT) for the device.

The touchpad is physically integrated into the Type Cover, so add a hwdb
entry in `70-touchpad.hwdb` that overrides
`ID_INPUT_TOUCHPAD_INTEGRATION=internal`, restoring DWT.

Fixes #43256

7 days agoinclude: update kernel headers from v7.2-rc5
Yu Watanabe [Sun, 2 Aug 2026 10:30:47 +0000 (19:30 +0900)] 
include: update kernel headers from v7.2-rc5

It seems there is no notable changes to us.

7 days agosocket: parse message queue size as IEC size
dongshengyuan [Fri, 31 Jul 2026 07:52:43 +0000 (15:52 +0800)] 
socket: parse message queue size as IEC size

Allow MessageQueueMessageSize= to accept IEC size suffixes in socket unit files.
Support the same syntax for transient property assignments.
Keep MessageQueueMaxMessages= as a plain message count.

7 days agosd-id128: parse UUID URNs
dongshengyuan [Fri, 31 Jul 2026 07:23:47 +0000 (15:23 +0800)] 
sd-id128: parse UUID URNs

Accept RFC4122 UUID URN strings with the `urn:uuid:` prefix in
sd_id128_from_string(), while keeping plain 128-bit IDs and regular
UUID strings working as before.

7 days agoudevadm: improve symlink query output
dongshengyuan [Fri, 31 Jul 2026 07:10:51 +0000 (15:10 +0800)] 
udevadm: improve symlink query output

Implement the TODO item for `udevadm info -q symlink`: keep the
default space-separated output pager-free, and make `--value` print
one symlink per line with an empty separator line between devices.

7 days agopo: resynchronize translations on Weblate
Frantisek Sumsal [Sun, 2 Aug 2026 00:17:35 +0000 (00:17 +0000)] 
po: resynchronize translations on Weblate

Weblate got itself into a conflict and while resolving it it forced a
resynchronization of all translations, which in combination with a new
version of Weblate triggered a lot of rather pointless
multiline-to-singleline (and vice versa) changes. Let's squash all this
noise into a single commit to make both Weblate and us happy.

C.f. https://github.com/systemd/systemd/pull/43248.

7 days agoreport: replace boolean --sign with signing modes
Paul Meyer [Fri, 17 Jul 2026 14:53:50 +0000 (16:53 +0200)] 
report: replace boolean --sign with signing modes

Turn --sign=BOOL into --sign=no|best-effort|require-one|require-all,
making the multi-signer aggregation policy explicit: best-effort never
fails on signing, require-one requires at least one signature, and
require-all requires every signer to succeed (an empty reply, i.e. a
signer opting out, counts as failure). Signed reports are always emitted
as a JSON-SEQ stream. The mode is also exposed as an input to the
io.systemd.Report.GenerateSigned Varlink method.

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
7 days agosd-json: encode pidref fd_id as unsigned
Eric Boucher [Mon, 27 Apr 2026 01:04:07 +0000 (21:04 -0400)] 
sd-json: encode pidref fd_id as unsigned

PidRef.fd_id is uint64_t.

8 days agoselinux: alternate root support (#42768)
Zbigniew Jędrzejewski-Szmek [Sun, 2 Aug 2026 00:06:12 +0000 (02:06 +0200)] 
selinux: alternate root support (#42768)

This PR changes some SELinux bits related to working with alternate
roots (specifically when using `--root` or `--image` on a bunch of
executables).

It addresses bug #42643 and it's hopefully the more whole approach than
the naive approach I PR'ed in #42644.

Before this PR the 'wrong' labels get applied because the path lookups
in the SELinux label database are prefixed with whatever the location of
the alternate root is (explained in more detail below).

Initially I had taken a very naive approach that did fix the issue by
stripping the alternate root from the path; however this still looks up
that path in the hosts' label database, which might differ from the one
contained in the alternate root.

So this expanded approach actually reads the label database from the
alternate root, strips the prefix *if* an alternate root is used
directly in `selinux-util.c` and then uses that to assign labels
instead.

See under the line for the behavior pre/post.

I've tried builds of this PR on both enforcing/non-enforcing/non-enabled
hosts *and* on enabled/non-enabled disk images and things seem to work
or at least fall back to ignoring MAC when required bits aren't present.

One thing is *if* an `/etc/selinux/config` is present that defines a
`SELINUXTYPE=` we *do* require the policy given to be present in the
image. This is the only new actual error in this code path that doesn't
get ignored.

We *could* verify that the path exists and also ignore it but I
personally don't think that's the right approach since the actual system
itself would likely also be broken anyhow. Let me know thoughts on that.

There's a tight coupling here still with the *hosts* SELinux policy in
that to set (potentially) unknown labels to the policy loaded in the
host kernel these executables would need to execute in a domain that
allows transitioning to `mac_admin`. I'd say that `install_t` is the
most likely candidate for that. See the first comment on this PR for
more explanation on it/request for input.

---

When mounting `a.raw` before running any tooling against it and showing
the `/etc/shadow` file labels we have:

```
€ sudo systemd-dissect --mount test/a.raw test/mnt/a
€ ls -Zlart test/mnt/a/etc/shadow
----------. 1 root root system_u:object_r:shadow_t:s0 520 Jun 27 07:55 test/mnt/a/etc/shadow
€ sudo systemd-dissect ---umount test/mnt/a
```

After running `systemd-firstboot` against the image, then remounting,
note the labels that have been changed to incorrect values:

```
€ sudo systemd-firstboot --image test/a.raw --root-password test
/home/user/src/github.com/teamsbc/artifacts/test/a.raw: /etc/passwd written.
/home/user/src/github.com/teamsbc/artifacts/test/a.raw: /etc/shadow written.
€ sudo systemd-dissect --mount test/a.raw test/mnt/a
€ ls -Zlart test/mnt/a/etc/shadow
----------. 1 root root system_u:object_r:init_var_run_t:s0 579 Jun 27 08:01 test/mnt/a/etc/shadow
```

The behavior before this PR looks up the labels in the label database of
the host, but the path that gets looked up is the path where the image
is temporarily mounted, or in the case of `--root` where the root is on
the host. Since that path doesn't define any labels we get the labels of
the location where the file was created on the host. In this case since
`--image` was used, which mounted things in a temporary location we end
up with `var_run_t`.

If this image is booted things that want to read `/etc/shadow` might not
be allowed to read files labeled this way; thus services fail to start,
and root can't login when SELinux is in enforcing mode.

After this PR is applied there are two main differences in how things
are handled. The first being that instead of reading the label database
from the host (which might have none, or have a different one from the
one contained inside an image or root) we read the label database from
inside the alternate root. This tries to make sure we get the correct
labels for given paths.

Second, and most importantly, if we did init SELinux with an alternate
root then any paths passed to the relevant label lookup functions strip
that alternate root from the path. While previously we'd look up a path
like `/run/dissect-XXXX/etc/shadow` we now look up a path like
`/etc/shadow` *and* this path gets looked up in the label database in
the alternate root.

Together these things give in my opinion better handling of SELinux in
alternate roots. To confirm things work here's the same operations on
the second copy of our image:

```
€ sudo systemd-dissect --mount test/b.raw test/mnt/b
artifacts € ls -Zlart test/mnt/b/etc/shadow
----------. 1 root root system_u:object_r:shadow_t:s0 520 Jun 27 07:55 test/mnt/b/etc/shadow
€ sudo ~/src/github.com/systemd/systemd/build/systemd-firstboot --image test/b.raw --root-password test
/home/user/src/github.com/teamsbc/artifacts/test/b.raw: /etc/passwd written.
/home/user/src/github.com/teamsbc/artifacts/test/b.raw: /etc/shadow written.
€ sudo systemd-dissect --mount test/b.raw test/mnt/b
€ ls -Zlart test/mnt/b/etc/shadow
----------. 1 root root system_u:object_r:shadow_t:s0 579 Jun 27 08:44 test/mnt/b/etc/shadow
```

Showing that we now have the correct labels applied.

8 days agoproperties: Skip unnecessary per property filtering (#43146)
Chris Down [Sat, 1 Aug 2026 20:30:59 +0000 (13:30 -0700)] 
properties: Skip unnecessary per property filtering (#43146)

In total this can save ~18% CPU on `systemctl show` nominal queries in
my tests.

8 days agopo: Translated using Weblate (Russian)
Andrei Stepanov [Sat, 1 Aug 2026 15:17:57 +0000 (15:17 +0000)] 
po: Translated using Weblate (Russian)

Currently translated at 100.0% (286 of 286 strings)

Co-authored-by: Andrei Stepanov <adem4ik@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/ru/
Translation: systemd/main

[zjs: made some small corrections based on Claude comments.]

8 days agobuild(deps): bump the actions group with 6 updates
dependabot[bot] [Sat, 1 Aug 2026 09:35:33 +0000 (09:35 +0000)] 
build(deps): bump the actions group with 6 updates

Bumps the actions group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` |
| [actions/setup-python](https://github.com/actions/setup-python) | `6.3.0` | `7.0.0` |
| [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.36.2` | `4.37.3` |
| [aws-actions/configure-aws-credentials](https://github.com/aws-actions/configure-aws-credentials) | `6.2.0` | `6.2.3` |
| [softprops/action-gh-release](https://github.com/softprops/action-gh-release) | `3.0.1` | `3.0.2` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.4.3` | `2.4.4` |

Updates `actions/checkout` from 7.0.0 to 7.0.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0...3d3c42e5aac5ba805825da76410c181273ba90b1)

Updates `actions/setup-python` from 6.3.0 to 7.0.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/ece7cb06caefa5fff74198d8649806c4678c61a1...5fda3b95a4ea91299a34e894583c3862153e4b97)

Updates `github/codeql-action/upload-sarif` from 4.36.2 to 4.37.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8aad20d150bbac5944a9f9d289da16a4b0d87c1e...e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81)

Updates `aws-actions/configure-aws-credentials` from 6.2.0 to 6.2.3
- [Release notes](https://github.com/aws-actions/configure-aws-credentials/releases)
- [Changelog](https://github.com/aws-actions/configure-aws-credentials/blob/main/CHANGELOG.md)
- [Commits](https://github.com/aws-actions/configure-aws-credentials/compare/e7f100cf4c008499ea8adda475de1042d6975c7b...e6de054238d6b7531b4efff3b6587d9aade6a06c)

Updates `softprops/action-gh-release` from 3.0.1 to 3.0.2
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/718ea10b132b3b2eba29c1007bb80653f286566b...3d0d9888cb7fd7b750713d6e236d1fcb99157228)

Updates `ossf/scorecard-action` from 2.4.3 to 2.4.4
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/4eaacf0543bb3f2c246792bd56e8cdeffafb205a...2d1146689b8cda280b9bc96326124645441f03bc)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: github/codeql-action/upload-sarif
  dependency-version: 4.37.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: aws-actions/configure-aws-credentials
  dependency-version: 6.2.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
8 days agobuild(deps): bump meson from 1.11.1 to 1.11.2 in /.github/workflows
dependabot[bot] [Sat, 1 Aug 2026 09:32:38 +0000 (09:32 +0000)] 
build(deps): bump meson from 1.11.1 to 1.11.2 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.11.1...1.11.2)

---
updated-dependencies:
- dependency-name: meson
  dependency-version: 1.11.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
8 days agoproperties: Skip value building for nominal case 43146/head
Chris Down [Fri, 24 Jul 2026 23:18:27 +0000 (16:18 -0700)] 
properties: Skip value building for nominal case

bus_message_print_all_properties() builds a PROP= string for every
property in the reply so that -p PROP=value filters can be matched
against it, but most queries never need this.

Take the normal `systemctl show` or `systemctl show UNIT` case. In that
case there is no filter. Even with `-p PROP` there is no value filter
since there is no value.

Avoid constructing the string entirely by comparing property names
directly against filter entries.

In my tests with a `systemctl show` over 160 units this brings the
instructions retired from 992.6M down to 960.5M, a reduction of 3.2%.

The same goes for property filters with units. When running:

    systemctl show -p UnitFileState -p ActiveState UNIT

...the instructions retired drops from 9.52M to 9.22M, a reduction of
3.2%. The output in each case is unchanged.

9 days agoproperties: Peek the variant value type once (#43145)
Chris Down [Sat, 1 Aug 2026 01:16:56 +0000 (18:16 -0700)] 
properties: Peek the variant value type once (#43145)

bus_message_print_all_properties() peeks the variant type, but then the
print callback and the default bus_print_property() each peek the value
type again, so there can be up to two redundant calls per property. Peek
it once up front and pass it through.

With this, in my tests `systemctl show` over 160 units decreases in
instructions retired from 1167.6M to 1155.7M, so about 1%.

9 days agoproperties: Peek the variant value type once 43145/head
Chris Down [Sat, 18 Jul 2026 22:18:27 +0000 (15:18 -0700)] 
properties: Peek the variant value type once

bus_message_print_all_properties() peeks the variant type, but then the
print callback and the default bus_print_property() each peek the value
type again, so there can be up to two redundant calls per property. Peek
it once up front and pass it through.

With this, in my tests `systemctl show` over 160 units decreases in
instructions retired from 1167.6M to 1155.7M, so about 1%.

9 days agoproperties: Skip found set building for nominal case
Chris Down [Fri, 24 Jul 2026 23:08:16 +0000 (16:08 -0700)] 
properties: Skip found set building for nominal case

bus_message_print_all_properties() inserts every name it walks into the
found-properties set, but the set is only used to report missing requested
properties at debug level.

Request the set from systemctl only when properties were specified and debug
logging is enabled, avoiding the unnecessary work in normal operation.

In my tests with `systemctl show` over 160 units this brings the
instructions retired from 1167.8M down to 992.6M, a reduction of 15.0%.
The output is unchanged.

9 days agotest: TEST-89: remove temporary files when browse helpers return
Christian Glombek [Thu, 30 Jul 2026 04:37:47 +0000 (06:37 +0200)] 
test: TEST-89: remove temporary files when browse helpers return

The RETURN traps in the browse helpers only stopped the transient
varlinkctl unit; the mktemp'd output/error/scratch files were never
removed and leaked on every invocation. Remove them from the same trap,
after the unit has been stopped so that nothing is still writing to
them, and make that stop best-effort like in
testcase_browse_ifindex_zero_no_flap: if varlinkctl exited on its own,
the transient unit is already gone, and a failing stop would otherwise
abort the testcase under errexit and skip the removal.

testcase_browse_ifindex_zero_no_flap cleans up its output file from the
trap it already arms for the dummy link, which is an EXIT trap since
run_testcases runs each testcase in its own subshell.

While at it, tidy up the helpers' variable scoping: error_file was
accidentally a global, and i/svc were declared in the wrong functions
(they are used by check_both/check_first, via dynamic scoping).