]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 weeks agonetworkctl: change bitrate format from 'bps' to 'Bps'
Anton Tiurin [Tue, 16 Sep 2025 20:58:56 +0000 (21:58 +0100)] 
networkctl: change bitrate format from 'bps' to 'Bps'

6 weeks agonspawn: free D-Bus error before fallback (#39131)
Luca Boccassi [Fri, 26 Sep 2025 05:00:48 +0000 (06:00 +0100)] 
nspawn: free D-Bus error before fallback (#39131)

Otherwise the next call fails:

Got message type=error sender=:1.5 destination=:1.470 path=n/a
    interface=n/a member=n/a cookie=151 reply_cookie=3 signature=s
    error-name=org.freedesktop.DBus.Error.UnknownMethod
    error-message=Unknown method CreateMachineEx or interface
    org.freedesktop.machine1.Manager. Assertion
'!bus_error_is_dirty(reterr_error)' failed at
    src/libsystemd/sd-bus/sd-bus.c:2396, function sd_bus_call(). Aborting.

Follow-up for d80af3b97b94e450a002ddac13874a953f0eab3e

6 weeks agocore: assorted fixes and cleanups for cgroup (#39094)
Yu Watanabe [Fri, 26 Sep 2025 04:56:25 +0000 (13:56 +0900)] 
core: assorted fixes and cleanups for cgroup (#39094)

6 weeks agotimer: fix unexpected triggering of service immediately after restart of a timer...
Yu Watanabe [Fri, 26 Sep 2025 00:51:36 +0000 (09:51 +0900)] 
timer: fix unexpected triggering of service immediately after restart of a timer (#38868)

Fixes: #31231
Fixes: #35805
6 weeks agocore/bpf-firewall: replace unnecessary unit_setup_cgroup_runtime() with unit_get_cgro... 39094/head
Yu Watanabe [Tue, 23 Sep 2025 19:45:21 +0000 (04:45 +0900)] 
core/bpf-firewall: replace unnecessary unit_setup_cgroup_runtime() with unit_get_cgroup_runtime()

Except for the test, bpf_firewall_compile() is only called by the following:
  cgroup_context_apply() -> cgroup_apply_firewall() -> bpf_firewall_compile()
and in the early stage of cgroup_context_apply(), it checks if the cgroup
runtime exists. Hence, it is not necessary to try to allocate the
runtime in bpf_firewall_compile().

6 weeks agocore/bpf-firewall: make failures in loading custom BPF program not critical
Yu Watanabe [Tue, 23 Sep 2025 21:02:22 +0000 (06:02 +0900)] 
core/bpf-firewall: make failures in loading custom BPF program not critical

All other resource control features work as 'best-effort', and failures
in applying them are handled gracefully. However, unlike the other features,
we tested if the BPF programs can be loaded and refuse execution on failure.

Moreover, the previous behavior of testing loading BPF programs had
inconsistency: the test was silently skipped if the cgroup for the unit does
not exist yet, but tested when the cgroup already exists.

Let's not handle failures in loading custom BPF programs as critical, but
gracefully ignore them, like we do for the other resource control features.

Follow-up for fab347489fcfafbc8367c86afc637ce1b81ae59e.

6 weeks agocore/unit: fail earlier before spawning executor when we failed to realize cgroup
Yu Watanabe [Tue, 23 Sep 2025 20:29:22 +0000 (05:29 +0900)] 
core/unit: fail earlier before spawning executor when we failed to realize cgroup

Before 23ac08115af83e3a0a937fa207fc52511aba2ffa, even if we failed to
create the cgroup for a unit, a cgroup runtime object for the cgroup is
created with the cgroup path. Hence, the creation of cgroup is failed,
execution of the unit will fail in posix_spawn_wrapper() and logged
something like the following:
```
systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory
systemd[1]: testservice.service: Failed to spawn executor: No such file or directory
systemd[1]: testservice.service: Failed to spawn 'start' task: No such file or directory
systemd[1]: testservice.service: Failed with result 'resources'.
systemd[1]: Failed to start testservice.service.
```

However, after the commit, when we failed to create the cgroup, a cgroup
runtime object is not created, hence NULL will be assigned to
ExecParameters.cgroup_path in unit_set_exec_params().
Hence, the unit process will be invoked in the init.scope.
```
systemd[1]: testservice.service: Failed to create cgroup /testslice.slice/testservice.service: Cannot allocate memory
systemd[1]: Starting testservice.service...
cat[1094]: 0::/init.scope
systemd[1]: testservice.service: Deactivated successfully.
systemd[1]: Finished testservice.service.
```
where the test service calls 'cat /proc/self/cgroup'.

To fix the issue, let's fail earlier when we failed to create cgroup.

Follow-up for 23ac08115af83e3a0a937fa207fc52511aba2ffa (v258).

6 weeks agolibmount: make dlopen() dependency
Lennart Poettering [Wed, 24 Sep 2025 20:36:30 +0000 (22:36 +0200)] 
libmount: make dlopen() dependency

6 weeks agomachined: introduce per-user instance (#39123)
Yu Watanabe [Thu, 25 Sep 2025 23:16:18 +0000 (08:16 +0900)] 
machined: introduce per-user instance (#39123)

This is the first part of #38728, just the machined stuff, no the
importd stuff.

This definitely makes sense of its own, hence let's get this in first.

The original PR contains a tescase that tests machined + importd in
combination. This PR here hence is without a testcase, but it's there,
just in the other PR.

This looks large and is large, but do note that much of the machined
changes are very repetitive: they conditionalize PK checks to the system
version, as PK doesn't make sense in the use rversion.

6 weeks agocore/cgroup: make sure deserialized accounting data is not voided (#39130)
Yu Watanabe [Thu, 25 Sep 2025 22:54:48 +0000 (07:54 +0900)] 
core/cgroup: make sure deserialized accounting data is not voided (#39130)

6 weeks agoman: fix typo
Yu Watanabe [Thu, 25 Sep 2025 22:23:56 +0000 (07:23 +0900)] 
man: fix typo

Follow-up for 73ee723aa77bfb9f9988b80228b646d65d1770b2.

6 weeks agointegration tests: do not adjust log level in the test script
Yu Watanabe [Wed, 24 Sep 2025 15:46:35 +0000 (00:46 +0900)] 
integration tests: do not adjust log level in the test script

We passes log level through kernel command line. It is not necessary to
set to debug level at the beginning, and set to info at the end.
This is important when a test has several subtests. If a subtest sets
log level to info at the end, then subsequent tests may not generate any
useful logs.

6 weeks agolibseccomp: fix build error
Matteo Croce [Thu, 25 Sep 2025 19:48:26 +0000 (21:48 +0200)] 
libseccomp: fix build error

When HAVE_SECCOMP is not set, a build error happens:

../src/analyze/analyze-security.c: In function ‘get_security_info’:
../src/analyze/analyze-security.c:2449:13: error: unused variable ‘r’ [-Werror=unused-variable]
 2449 |         int r;
      |             ^
cc1: some warnings being treated as errors

Fix it by removing the sometimes unused variable.

6 weeks agocore/cgroup: make sure deserialized accounting data is not voided 39130/head
Mike Yuan [Thu, 25 Sep 2025 20:28:33 +0000 (22:28 +0200)] 
core/cgroup: make sure deserialized accounting data is not voided

Currently, cgroup_path is (de-)serialized after all the cached
accounting data. This is bogus though, since unit_set_cgroup_path()
destroys the CGroupRuntime object and starts afresh, discarding
all deserialized values. This matters especially for IP accounting,
whose BPF maps get recreated on reload/reexec and the previous values
are exclusively retrievable from deserialization. Let's hence swap things
around and serialize cgroup_path first, accounting data only afterwards.

6 weeks agocore/cgroup: realign macro line continuation
Mike Yuan [Thu, 25 Sep 2025 20:33:19 +0000 (22:33 +0200)] 
core/cgroup: realign macro line continuation

6 weeks agomachined: make image locking runtime scope aware, too 39123/head
Lennart Poettering [Tue, 15 Jul 2025 15:21:52 +0000 (17:21 +0200)] 
machined: make image locking runtime scope aware, too

We cannot create an image lock in /run if we are unpriv, hence create it
in $XDG_RUNTIME_DIR instead.

6 weeks agomachinectl: add support for user-scoped operation
Lennart Poettering [Tue, 15 Jul 2025 11:08:33 +0000 (13:08 +0200)] 
machinectl: add support for user-scoped operation

6 weeks agomachined: allow running in --user mode
Lennart Poettering [Tue, 15 Jul 2025 10:15:19 +0000 (12:15 +0200)] 
machined: allow running in --user mode

6 weeks agodiscover-image: support runtime scope also for .nspawn settings files and the pool dir
Lennart Poettering [Tue, 15 Jul 2025 10:13:27 +0000 (12:13 +0200)] 
discover-image: support runtime scope also for .nspawn settings files and the pool dir

discover-image.[ch] largely already supports per-scope operations, let's
extend this however to also cover finding .nspawn settings files and
managing the pool dir.

6 weeks agoservice-util: add generic parser for runtime scope
Lennart Poettering [Tue, 15 Jul 2025 06:44:48 +0000 (08:44 +0200)] 
service-util: add generic parser for runtime scope

6 weeks agopath-lookup: add runtime_directory_generic() helper
Lennart Poettering [Tue, 15 Jul 2025 10:34:39 +0000 (12:34 +0200)] 
path-lookup: add runtime_directory_generic() helper

6 weeks agoruntime-scope: add runtime_scope_to_socket_mode() helper
Lennart Poettering [Tue, 15 Jul 2025 10:34:22 +0000 (12:34 +0200)] 
runtime-scope: add runtime_scope_to_socket_mode() helper

6 weeks agoosc-context: fix typo: 8003 -> 3008
Yu Watanabe [Thu, 25 Sep 2025 17:16:17 +0000 (02:16 +0900)] 
osc-context: fix typo: 8003 -> 3008

Follow-up for dadbb34919abd3fefeb5b8ccc9794da9398a2503 (v258).

6 weeks agomachined: do not allow unprivileged users to shell into the root namespace
Luca Boccassi [Wed, 24 Sep 2025 14:42:51 +0000 (15:42 +0100)] 
machined: do not allow unprivileged users to shell into the root namespace

We intend to make self-registering machines an unprivileged operation,
but currently that would allow an unprivileged user to register a
process they own in the root namespace, and then login as any
user they like, including root, which is not ideal.

Forbid non-root from shelling into a machine that is running in
the root user namespace.

6 weeks agoresolve: undo change to return code of next_search_domain() (#39119)
Mantas Mikulėnas [Thu, 25 Sep 2025 19:52:18 +0000 (22:52 +0300)] 
resolve: undo change to return code of next_search_domain() (#39119)

This caused resolved to only consider the 1st search domain of every
interface and ignore the rest.

Fixes a regression caused by 81ae2237c1792943a1ec712ae2e630bcc592175b (v258).
Fixes #39118.

6 weeks agolibseccomp: turn into dlopen() dependency
Lennart Poettering [Mon, 8 Sep 2025 15:17:05 +0000 (17:17 +0200)] 
libseccomp: turn into dlopen() dependency

6 weeks agofind-esp: fix error handling
Yu Watanabe [Thu, 25 Sep 2025 16:08:53 +0000 (01:08 +0900)] 
find-esp: fix error handling

Follow-up for 4b2b2f3ab710e328f1712a3f5e7480817c7a6ccd.

6 weeks agomkosi: pull in bsdutils for script, used by various integration tests
Luca Boccassi [Thu, 25 Sep 2025 12:41:58 +0000 (13:41 +0100)] 
mkosi: pull in bsdutils for script, used by various integration tests

4971s TEST-74-AUX-UTILS.sh[1212]: + script -ec 'networkctl edit --runtime "$NETWORK_NAME"' /dev/null
4971s TEST-74-AUX-UTILS.sh[1269]: .//usr/lib/systemd/tests/testdata/units/TEST-74-AUX-UTILS.networkctl.sh: line 55: script: command not found

Currently works due to a transitive dependency somewhere else
that is being dropped, pull it in directly given the tool is
used by the tests

6 weeks agodissect: Add more debug logging
Daan De Meyer [Thu, 25 Sep 2025 10:09:29 +0000 (12:09 +0200)] 
dissect: Add more debug logging

Currently it's next to impossible to find out why dissect_image()
has failed with EADDRNOTAVAIL, so let's add debug logging and use
EREMOTE for the different architectures error to help out with
debugging a bit.

6 weeks agocgroup-util: add pidref+full counter parts for cg_pid_get_user_unit()
Lennart Poettering [Wed, 27 Aug 2025 12:01:44 +0000 (14:01 +0200)] 
cgroup-util: add pidref+full counter parts for cg_pid_get_user_unit()

This completes the set of functions for getting the user unit of a
process, mirroring the four functions we already have for the system
unit.

6 weeks agotmpfile: minor modernizations
Lennart Poettering [Wed, 16 Jul 2025 05:16:06 +0000 (07:16 +0200)] 
tmpfile: minor modernizations

6 weeks agomountfsd: slightly relax restrictions on dir fds to mount
Lennart Poettering [Wed, 20 Aug 2025 09:37:06 +0000 (11:37 +0200)] 
mountfsd: slightly relax restrictions on dir fds to mount

When establishing a idmapped mount for a directory with foreign mapping
we so far insisted in the dir being properly opened (i.e. via a
non-O_PATH fd) being passed to mountfsd. This is problematic however,
since the client might not actually be able to open the dir (which after
all is owned by the foreign UID, not by the user). Hence, let's relax
the rules, and accept an O_PATH fd too (which the client can get even
without privs). This should be safe, since the load-bearing security
check is whether the dir has a parent owned by the client's UID, and
for that check O_PATH or not O_PATH is not relevant.

6 weeks agotimer: don't run service immediately after restart of a timer 38868/head
Lukas Nykryn [Tue, 9 Sep 2025 13:24:22 +0000 (15:24 +0200)] 
timer: don't run service immediately after restart of a timer

When a timer is restarted, don't reset the last_trigger field.
This prevents the timer from triggering immediately.

Fixes: #31231
6 weeks agotest: check the next elapse timer timestamp after deserialization
Frantisek Sumsal [Tue, 23 Sep 2025 19:04:12 +0000 (21:04 +0200)] 
test: check the next elapse timer timestamp after deserialization

When deserializing a serialized timer unit with RandomizedDelaySec= set,
systemd should use the last inactive exit timestamp instead of current
realtime to calculate the new next elapse, so the timer unit actually
runs in the given calendar window.

Provides coverage for:
  - https://github.com/systemd/systemd/issues/18678
  - https://github.com/systemd/systemd/pull/27752

6 weeks agolibblkid: fix build with blkid disabled
Antonio Alvarez Feijoo [Thu, 25 Sep 2025 07:39:56 +0000 (09:39 +0200)] 
libblkid: fix build with blkid disabled

Prompted by c349edfe49dc2c4b8a79e5d08ecf7c8e93c4c909, but it didn't work before.

6 weeks agoloop-util: fully suppress unnecessary size changes
Lennart Poettering [Wed, 27 Aug 2025 19:42:39 +0000 (21:42 +0200)] 
loop-util: fully suppress unnecessary size changes

Typically we set the offset argument to UINT64_MAX in most calls, but
this caused us to not detect no-change invocations. Fix that.

6 weeks agolibblkid → turn into dlopen() dependency (#39084)
Lennart Poettering [Wed, 24 Sep 2025 19:15:01 +0000 (21:15 +0200)] 
libblkid → turn into dlopen() dependency (#39084)

Split out of #38861

6 weeks agoblkid-util: add blkid_probe_lookup_value_id128() helper 39084/head
Lennart Poettering [Mon, 8 Sep 2025 20:27:34 +0000 (22:27 +0200)] 
blkid-util: add blkid_probe_lookup_value_id128() helper

And similar, add a blkid_probe_lookup_value_u64() helper

6 weeks agolibblkid: turn into dlopen() based dep
Lennart Poettering [Mon, 8 Sep 2025 17:17:40 +0000 (19:17 +0200)] 
libblkid: turn into dlopen() based dep

6 weeks agomeson: drop libblkid dep from components not using it directly
Lennart Poettering [Wed, 24 Sep 2025 08:13:35 +0000 (10:13 +0200)] 
meson: drop libblkid dep from components not using it directly

6 weeks agofirstboot: some love (#39070)
Yu Watanabe [Wed, 24 Sep 2025 15:38:23 +0000 (00:38 +0900)] 
firstboot: some love (#39070)

This is split out of #38764.

It mostly introduces the "chrome" stuff that puts a blue at the top of
bottom of the terminal screen when going through interactive tools such
as firstboot, homed-firstboot, and (in future) systemd-sysinstall).

it also introduces a generic "prompt_loop()" helper thatn queries the
user for some option in a loop until the rsponse matches certain
requirements. It's a generalization of a function of the same name that
so far only existed in firstboot.c. The more generic version will be
reused in a later PR by homed-firstboot and by sysinstall.

6 weeks agoman: Add missing parentheses
Daan De Meyer [Wed, 24 Sep 2025 14:30:02 +0000 (16:30 +0200)] 
man: Add missing parentheses

6 weeks agomachine: fix wrong field name in varlink IDL
Yu Watanabe [Wed, 24 Sep 2025 12:46:51 +0000 (21:46 +0900)] 
machine: fix wrong field name in varlink IDL

Follow-up for d5feeb373cc13d96fa66967a6bdb7461df32c920 (v258).

6 weeks agoboot: two trivial cleanups (#39093)
Yu Watanabe [Wed, 24 Sep 2025 14:18:00 +0000 (23:18 +0900)] 
boot: two trivial cleanups (#39093)

6 weeks agofirstboot: don't call this thing a "wizard" 39070/head
Lennart Poettering [Thu, 11 Sep 2025 19:12:15 +0000 (21:12 +0200)] 
firstboot: don't call this thing a "wizard"

It isn't really, it's an initial setup tool, which is what GNOME calls
their equivalent too.

6 weeks agofirstboot: modernize --help output
Lennart Poettering [Thu, 11 Sep 2025 09:25:13 +0000 (11:25 +0200)] 
firstboot: modernize --help output

6 weeks agofirstboot: show blue "chrome" bar at top
Lennart Poettering [Thu, 11 Sep 2025 09:25:00 +0000 (11:25 +0200)] 
firstboot: show blue "chrome" bar at top

6 weeks agoprompt-util: add helpers that paint some "chrome" on top/bottom of screen
Lennart Poettering [Fri, 29 Aug 2025 21:24:33 +0000 (23:24 +0200)] 
prompt-util: add helpers that paint some "chrome" on top/bottom of screen

We'll soon have three different kind of interactive "wizard"-like console
UIs: systemd-firstboot, homectl firstboot and soon systemd-sysinstall.
Let's give them a limited, recognizable visual identity, to distinguish
them from the usual console output: let's add a bit of "chrome" to the
top and bottom of the screen, that we show during ther wizards, but hide
again afterwards.

This makes use of the DECSTBM sequence that reduces the scrolling area
by chopping off blocks from the top or bottom of the screen. The
sequence is quite standard, given it has been part of VT100 already.
xterm, vte, Linux console all support it just fine.

6 weeks agomacro: add simple DEFER_VOID_CALL() helper
Lennart Poettering [Fri, 29 Aug 2025 21:19:35 +0000 (23:19 +0200)] 
macro: add simple DEFER_VOID_CALL() helper

6 weeks agopretty-print: add WITH_BUFFERED_STDOUT() helper
Lennart Poettering [Fri, 29 Aug 2025 21:16:01 +0000 (23:16 +0200)] 
pretty-print: add WITH_BUFFERED_STDOUT() helper

6 weeks agoterminal-util: add terminal_get_cursor_position() helper
Lennart Poettering [Fri, 29 Aug 2025 21:15:45 +0000 (23:15 +0200)] 
terminal-util: add terminal_get_cursor_position() helper

6 weeks agoprompt-util: add generic prompt loop implementation
Lennart Poettering [Thu, 28 Aug 2025 11:41:24 +0000 (13:41 +0200)] 
prompt-util: add generic prompt loop implementation

This is a generalization of the logic in systemd-firstboot. This also
ports over firstboot.c to make use of the new generalization.

6 weeks agoglyph-util: add more emojis
Lennart Poettering [Fri, 29 Aug 2025 13:17:13 +0000 (15:17 +0200)] 
glyph-util: add more emojis

6 weeks agomachined: add PIDFD D-Bus variants for registering/creating machines
Luca Boccassi [Tue, 16 Sep 2025 13:45:58 +0000 (14:45 +0100)] 
machined: add PIDFD D-Bus variants for registering/creating machines

Current methods take a numeric PID, but we know that is unreliable for
the usual reasons. Add variants that take a PIDFD instead, or a
PID + PIDFDID combination for remote users.

6 weeks agosd-boot: terminal handling tweaks (#39026)
Lennart Poettering [Wed, 24 Sep 2025 12:40:38 +0000 (14:40 +0200)] 
sd-boot: terminal handling tweaks (#39026)

Let's make sd-boot's terminal handling a bit cleaner, to the point that
uefi's weird handling allows this.

6 weeks agoboot: let's make the one space we output early on invisible 39026/head
Lennart Poettering [Fri, 19 Sep 2025 13:32:29 +0000 (15:32 +0200)] 
boot: let's make the one space we output early on invisible

let's place the cursor at the beginning of the line before/after, so we
know it's the first char we overwrite, and we return to the front again
right after.

6 weeks agoboot: return to beginning of line when enrolling
Lennart Poettering [Fri, 19 Sep 2025 13:31:53 +0000 (15:31 +0200)] 
boot: return to beginning of line when enrolling

6 weeks agoboot: work around ansi color issues between sd-boot, uefi and terminals
Lennart Poettering [Fri, 19 Sep 2025 12:54:08 +0000 (14:54 +0200)] 
boot: work around ansi color issues between sd-boot, uefi and terminals

So, UEFI's color texting is a bit weird. It translates everything to
ANSI sequences, but unlike ANSI sequences it has no understanding of a
distinct "default" bg/fg color, it assumes the ansi color "0" is always
equal to white on black, but that's of course not really true, most
terminal emulators at the very least support white background too.

tianocore then also tries to be smart and suppresses ANSI color changes
from a color to itself. But if the understanding of the color is wrong
in the first place, then any color change suppression like this hurts
more than it helps.

Then in addition there are certain terminal tools that will reset the bg
color on every line break ("less" for example) to the default.

Let's deal with that and improve the situation on all fronts:

1. force out color changes by doing two color changes whenever we really
   want it.

2. on every newline force out the color change again.

with this in place, using sd-boot on a terminal emulator is a lot nicer.

6 weeks agolibacl → turn into dlopen() dependency (#39087)
Yu Watanabe [Wed, 24 Sep 2025 09:25:20 +0000 (18:25 +0900)] 
libacl → turn into dlopen() dependency (#39087)

6 weeks agoboot: rename ENROLL_TIMEOUT_TYPE_MAX -> ENROLL_TIMEOUT_MAX 39093/head
Yu Watanabe [Wed, 24 Sep 2025 09:21:33 +0000 (18:21 +0900)] 
boot: rename ENROLL_TIMEOUT_TYPE_MAX -> ENROLL_TIMEOUT_MAX

To make it consistent with ENROLL_TIMEOUT_MIN.

Follow-up for 64376936c70ac1cba18fcdcaec8eb337d80c48a7.

6 weeks agoboot: use correct format specifier for timeout
Yu Watanabe [Tue, 23 Sep 2025 21:19:54 +0000 (06:19 +0900)] 
boot: use correct format specifier for timeout

This also drops space between number and 's', like we do in format_timespan(),
and fixes spurious type mismatch between timeout_sec and timeout_remain.

6 weeks agomeasure: strip tpm 1.x remnants and make GetActivePcrBanks() work (#39089)
Yu Watanabe [Wed, 24 Sep 2025 09:14:09 +0000 (18:14 +0900)] 
measure: strip tpm 1.x remnants and make GetActivePcrBanks() work (#39089)

Let's never bother with old TPM 1.x structures, they are not mentioned
in the TCG for TPM2 spec at all. However, the spec does say we should
check the Size field of the relevant structs, before accessing them,
hence do that.

Use that to determine the version of the protocol, before accessing
GetActiveBanks().

Alternative to: #39034
Fixes: #38932
Follow-up to: 6eab4cd44c3c43698dcfc2c3bc8cd31ed610a812

6 weeks agoudev-builtin-net_id: Add DeviceTree-based names for WLAN devices (#39060)
Yu Watanabe [Wed, 24 Sep 2025 09:10:27 +0000 (18:10 +0900)] 
udev-builtin-net_id: Add DeviceTree-based names for WLAN devices (#39060)

Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
u-boot set mac-address for wifi without an eeprom"

So we need to handle both while generating names. Refactor most of the
logic in names_devicetree() into a helper
names_devicetree_alias_prefix() that takes an alias_prefix instead of
hardcoding "ethernet", and, in the new names_devicetree():

- For prefix "en", use alias_prefix "ethernet"
- For prefix "wl", try alias_prefix "wifi" first, and if that was not
found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.

6 weeks agotest: restarting elapsed timer shouldn't trigger the corresponding service
Frantisek Sumsal [Tue, 23 Sep 2025 15:42:01 +0000 (17:42 +0200)] 
test: restarting elapsed timer shouldn't trigger the corresponding service

Provides coverage for:
  - https://github.com/systemd/systemd/issues/31231
  - https://github.com/systemd/systemd/issues/35805

6 weeks agotest: rename TEST-53-ISSUE-16347 to TEST-53-TIMER
Frantisek Sumsal [Tue, 23 Sep 2025 12:28:33 +0000 (14:28 +0200)] 
test: rename TEST-53-ISSUE-16347 to TEST-53-TIMER

And split the existing test into a separate subtest.

6 weeks agoacl: turn libacl dep into a dlopen() one 39087/head
Lennart Poettering [Tue, 23 Sep 2025 09:46:49 +0000 (11:46 +0200)] 
acl: turn libacl dep into a dlopen() one

I initially didn't think it would be worth doing this, but I changed my
mind. People out there quite successfully build systemd without ACL
support, and that suggests life without it is quite possible. Moreover
we only use it as very specific places:

1. in udev/logind for "uaccess" mgmt
2. in tmpfiles to implement explicitly configured acl changes
3. in journald/coredump/pstore to manage access to unpriv users
4. in pid1 to manage access to credential files
5. when shifting UIDs of container trees

I specific container environments it should be entirely fine to live without all
of these, hence let's pull this in on demand only.

6 weeks agotree-wide: drop deps on libacl
Lennart Poettering [Tue, 23 Sep 2025 09:44:44 +0000 (11:44 +0200)] 
tree-wide: drop deps on libacl

test-shift-uid.c doesn't actually use anything from libacl. It all goes
through shared/, and the dep there is enough.

Same for the coredump stuffi, logind and core/.

And pstore doesn't use it at all, neither directly or indirectly.

6 weeks agocleanup: add cleanup func macro that renames the function
Lennart Poettering [Tue, 23 Sep 2025 09:43:43 +0000 (11:43 +0200)] 
cleanup: add cleanup func macro that renames the function

This is useful when having to add a "sym_" prefix to functions

6 weeks agoboot: check protocol version before assuming GetActiveBanks() exists 39089/head
Lennart Poettering [Tue, 23 Sep 2025 11:42:02 +0000 (13:42 +0200)] 
boot: check protocol version before assuming GetActiveBanks() exists

Alternative to: #39034
Fixes: #38932
Follow-up to: 6eab4cd44c3c43698dcfc2c3bc8cd31ed610a812

6 weeks agomeasure: strip tpm 1.x remnants
Lennart Poettering [Tue, 23 Sep 2025 11:18:56 +0000 (13:18 +0200)] 
measure: strip tpm 1.x remnants

Let's never bother with old TPM 1.x structures, they are not mentioned
in the TCG for TPM2 spec at all. However, the spec does say we should
check the Size field of the relevant structs, before accessing them,
hence do that.

6 weeks agofs-util: prefer glibc's fchmodat() if possible
Luca Boccassi [Tue, 23 Sep 2025 22:13:23 +0000 (23:13 +0100)] 
fs-util: prefer glibc's fchmodat() if possible

Since v2.39 glibc's fchmodat() will call into the kernel's fchmodat2()
if flags are passed:

https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=65341f7bbea824d2ff9d37db15d8be162df42bd3;hp=c52c2c32db15aba8bbe1a0b4d3235f97d9c1a525

On older versions, if the flag is anything other than AT_SYMLINK_NOFOLLOW,
it returns EINVAL, so we can detect it and call the kernel syscall directly
ourselves.

Using the glibc wrappers when possible is prefereable so that programs
like fakeroot can intercept its calls and redirect them.

Follow-up for adecfb3bc0be0def49433277fcad5333893756cc

6 weeks agodocs: add a governance document
Lennart Poettering [Tue, 23 Sep 2025 15:01:13 +0000 (17:01 +0200)] 
docs: add a governance document

Since there have been disagreements on certain aspects of the technical
direction, let's clear things up, and introduce a governance document,
taking inspiration from:

https://github.com/uapi-group/uapi-group.github.io/blob/main/content/_index.md#governance

6 weeks agomkosi: update debian commit reference to 49dd9371a0c0dd08c7847c5885722eab88ac279f
Luca Boccassi [Tue, 23 Sep 2025 22:31:20 +0000 (23:31 +0100)] 
mkosi: update debian commit reference to 49dd9371a0c0dd08c7847c5885722eab88ac279f

49dd9371a0 d/rules: Ubuntu moved vmlinux.h too
c81ce364eb Install new files for upstream build
35abaf33bc Override more Lintian warnings about appstream
a3d3690c45 Override Lintian warning for appstream-metadata-missing-modalias-provide
1bcda1fd90 Override Lintian warning for binaries-have-file-conflict
c597c00ffc Drop versioned conflicts added for bullseye upgrades
9cd845af25 Override lintian warnings for conflicts-with-version
359da95d09 Override Lintian warning for spare-manual-page
3ef8c31cb2 Override Lintian warning for groff-message
dbe51582a9 Update changelog for 258-1 release
ffd971a27d autopkgtest: ensure /usr/sbin is in the PATH for unit-tests job
f086b8e881 autopkgtest: enable debug logs for unit-tests job
02142b9eae autopkgest: install dosfstools for test-loop-block
0319d890bd salsa-ci: enable ppc64el builds
645b1fa318 autopkgtest: use -20 instead of -22 for zstd compression
b8dc9b0ce7 salsa-ci: switch to recommended entry point yml
152a2b3140 autopkgtest: set default_device_timeout_sec=240
6d46436878 autopkgtest: manually compress logs on failure
c6c70bbb0c Update changelog for 258~rc4-1 release
2695112df7 Update changelog for 258~rc3-1 release
2c293cb2be systemd-boot: update version for rm_conffile

6 weeks agoudev-builtin-net_id: Add DeviceTree-based names for WLAN devices 39060/head
dramforever [Fri, 19 Sep 2025 13:52:00 +0000 (21:52 +0800)] 
udev-builtin-net_id: Add DeviceTree-based names for WLAN devices

Add support for generating names like wldN based on DeviceTree aliases.

DeviceTree alias names follow de facto conventions. As of writing, there
are so far two ways WLAN devices are represented in DeviceTree aliases
in upstream Linux DTS files:

- Firstly, as wifi0, used for example in t600x-j314-j316.dtsi
- Secondly, as ethernet0 or ethernet1, used for example in
  sun8i-q8-common.dtsi, with a comment saying the reason is to "Make
  u-boot set mac-address for wifi without an eeprom"

Therefore for prefix "wl", try alias_prefix "wifi" first, and if that
was not found, fall back to alias_prefix "ethernet"

Since this is a naming scheme change, also gate this behind
NAMING_DEVICETREE_ALIASES_WLAN and NAMING_V259, and document this
change.

6 weeks agoudev-builtin-net_id: Refactor names_devicetree() to avoid hardcoding
dramforever [Fri, 19 Sep 2025 13:52:00 +0000 (21:52 +0800)] 
udev-builtin-net_id: Refactor names_devicetree() to avoid hardcoding

Refactor most of the logic in names_devicetree() into a helper
names_devicetree_alias_prefix() that takes an alias_prefix instead of
hardcoding "ethernet".

The return value names_devicetree_alias_prefix() will be used in further
commits to allow for alias_prefix fallback.

6 weeks agotest: use relative paths to executables
Yu Watanabe [Sun, 21 Sep 2025 13:10:21 +0000 (22:10 +0900)] 
test: use relative paths to executables

This also makes shebang always use env command, and drops unnecessary
'bash -c' or 'sh -c' when a signle command is invoked in the shell,
like sleep or echo.

6 weeks agoudev,login: update ACL on static device nodes (#39071)
Lennart Poettering [Tue, 23 Sep 2025 12:27:36 +0000 (14:27 +0200)] 
udev,login: update ACL on static device nodes (#39071)

Fixes regression caused by #36444.
Fixes #39043.

6 weeks agologin: update ACL on static device nodes again 39071/head
Yu Watanabe [Tue, 23 Sep 2025 01:17:47 +0000 (10:17 +0900)] 
login: update ACL on static device nodes again

In the commit c960ca2be1cfd183675df581f049a0c022c1c802, the logic of
updating ACL on device node was moved from logind to udevd, but at that
time, mistakenly removed the logic for static nodes.

Fixes a regression caused by c960ca2be1cfd183675df581f049a0c022c1c802 (v258).
Fixes #39043.

6 weeks agoudev: move devnode_acl() back to libshared
Yu Watanabe [Tue, 23 Sep 2025 00:56:09 +0000 (09:56 +0900)] 
udev: move devnode_acl() back to libshared

This effectively reverts 1abb592f2f886913492e4967cc96816c167177a9.
No functional change, preparation for the next commit.

6 weeks agoboot: add support for overriding key enrollement timeout
Igor Opaniuk [Thu, 18 Sep 2025 15:49:32 +0000 (17:49 +0200)] 
boot: add support for overriding key enrollement timeout

Currently, a 15-second timeout is hardcoded for the key enrollment
process while waiting for user confirmation. Make this value configurable
to allow the option of disabling user input, such as during automatic key
provisioning at the factory.

Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
6 weeks agoFix sd_bus_can_send signature in manpage
Joshua Krusell [Tue, 23 Sep 2025 09:21:51 +0000 (11:21 +0200)] 
Fix sd_bus_can_send signature in manpage

6 weeks agorepart: add a very basic varlink interface (#39072)
Lennart Poettering [Tue, 23 Sep 2025 08:46:50 +0000 (10:46 +0200)] 
repart: add a very basic varlink interface (#39072)

This is split out of https://github.com/systemd/systemd/pull/38764.

It adds a very basic Varlink API to repart. Not the actual
repartitioning APIs, but simply a call to get a list of candidate
devices.

A very basic test case is added too.

Other commits from #38764 add the repartitioning API, but let's do that
in a separate PR.

6 weeks agotest: add simple testcase for io.systemd.Repart.ListCandidateDevices 39072/head
Lennart Poettering [Mon, 22 Sep 2025 10:19:42 +0000 (12:19 +0200)] 
test: add simple testcase for io.systemd.Repart.ListCandidateDevices

6 weeks agoblockdev-list,repart: optionally hide zero-size block devices
Lennart Poettering [Fri, 5 Sep 2025 12:23:12 +0000 (14:23 +0200)] 
blockdev-list,repart: optionally hide zero-size block devices

Block devices with removable media (e.g. SD card readers) indicate a
missing medium with a zero size. Optionally ignore such block devices
that carry no medium currently.

6 weeks agoblockdev-list,repart: optionally, filter list of candidate block device and remove...
Lennart Poettering [Thu, 28 Aug 2025 09:18:16 +0000 (11:18 +0200)] 
blockdev-list,repart: optionally, filter list of candidate block device and remove OS root disk

6 weeks agorepart: add basic Varlink support, for now only with a ListCandidateDevices() call
Lennart Poettering [Thu, 28 Aug 2025 09:19:41 +0000 (11:19 +0200)] 
repart: add basic Varlink support, for now only with a ListCandidateDevices() call

6 weeks agoblockdev-list: also pick up block device size
Lennart Poettering [Thu, 28 Aug 2025 08:56:06 +0000 (10:56 +0200)] 
blockdev-list: also pick up block device size

6 weeks agoblockdev-list: optionally return finds as list instead of writing it to stdout
Lennart Poettering [Thu, 28 Aug 2025 08:40:42 +0000 (10:40 +0200)] 
blockdev-list: optionally return finds as list instead of writing it to stdout

6 weeks agosd-device: add device_get_sysattr_u64() helper
Lennart Poettering [Thu, 28 Aug 2025 08:52:56 +0000 (10:52 +0200)] 
sd-device: add device_get_sysattr_u64() helper

6 weeks agoTwo follow-ups for dlopen()-ification (#39078)
Luca Boccassi [Mon, 22 Sep 2025 23:13:13 +0000 (00:13 +0100)] 
Two follow-ups for dlopen()-ification (#39078)

6 weeks agocore/systemd.pc: do not add new non-underscored vars
Mike Yuan [Mon, 22 Sep 2025 17:15:57 +0000 (19:15 +0200)] 
core/systemd.pc: do not add new non-underscored vars

Follow-up for 346b7b6b4931fc6bee9e820e0160dd024a86ed52

The old style was deprecated in
4908de44b0a0409f84a7cdc5641b114d6ce8ba03.

6 weeks agopam-util,libaudit-util: strip "lib" prefix from dlopen "feature" field 39078/head
Mike Yuan [Mon, 22 Sep 2025 15:38:57 +0000 (17:38 +0200)] 
pam-util,libaudit-util: strip "lib" prefix from dlopen "feature" field

As per our usual coding style.

6 weeks agopam-util: fix build without PAM
Mike Yuan [Mon, 22 Sep 2025 16:53:12 +0000 (18:53 +0200)] 
pam-util: fix build without PAM

Follow-up for 882c9ce0402ec6e37201628a9a361500ff39b1ed
Prompted by #39077

Note that HAVE_PAM ifdeffery in pam-util.c is removed,
since its build as a whole is conditioned out if
!HAVE_PAM in shared/meson.build.

6 weeks agojournal: fix two recent regressions in config handling (#39069)
Yu Watanabe [Mon, 22 Sep 2025 17:43:03 +0000 (02:43 +0900)] 
journal: fix two recent regressions in config handling (#39069)

Fixes #39046.
Fixes #39057.

6 weeks agolibaudit-util: fix build with audit disabled
Antonio Alvarez Feijoo [Mon, 22 Sep 2025 15:27:27 +0000 (17:27 +0200)] 
libaudit-util: fix build with audit disabled

```
In file included from ../src/test/test-dlopen-so.c:21:
../src/test/test-dlopen-so.c: In function ‘run’:
../src/test/test-dlopen-so.c:53:23: error: implicit declaration of function ‘dlopen_libaudit’; did you mean ‘dlopen_libfido2’? [-Werror=implicit-function-declaration]
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |                       ^~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-dlopen-so.c:53:9: note: in expansion of macro ‘ASSERT_DLOPEN’
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |         ^~~~~~~~~~~~~
../src/test/test-dlopen-so.c:53:23: warning: nested extern declaration of ‘dlopen_libaudit’ [-Wnested-externs]
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |                       ^~~~~~~~~~~~~~~
../src/shared/tests.h:181:24: note: in definition of macro ‘ASSERT_OK’
  181 |                 typeof(expr) _result = (expr);                                                                  \
      |                        ^~~~
../src/test/test-dlopen-so.c:53:9: note: in expansion of macro ‘ASSERT_DLOPEN’
   53 |         ASSERT_DLOPEN(dlopen_libaudit, HAVE_AUDIT);
      |         ^~~~~~~~~~~~~

```

Follow-up for 4d8c5c657ae0829f93944a00302e7ce700913e54

6 weeks agojournal: make JournalConfig.set_audit as enum 39069/head
Yu Watanabe [Mon, 22 Sep 2025 06:22:48 +0000 (15:22 +0900)] 
journal: make JournalConfig.set_audit as enum

In systemd <= 257, each set_audit tristate value had special meaning,
- true: enable the kernel audit subsystem,
- false: disable the kernel audit subsystem,
- negative: keep the current kernel audit subsystem state.

And the default is true, rather than negative. So, users sometimes
explicitly pass an empty string to Audit= setting to keep the state.

But since f48cf2a96dfdc23fe30ba0f870125fe55cab64c7 (v258), the negative
value is mistakenly used as 'really unspecified' even if an empty string
is explicitly specified.

This makes negative values handled as unspecified as usual, and assign a new
positive value AUDIT_KEEP for when an empty string is explicitly specified.
Also, make the Audit= setting accept "keep" setting, and suggest to use "keep"
rather than an empty string.

Fixes a regression caused by f48cf2a96dfdc23fe30ba0f870125fe55cab64c7 (v258).
Fixes #39057.

6 weeks agojournal: add missing initialization
Yu Watanabe [Mon, 22 Sep 2025 06:52:04 +0000 (15:52 +0900)] 
journal: add missing initialization

Otherwise, SplitMode= in journald.conf is always ignored.

Fixes a regression caused by f48cf2a96dfdc23fe30ba0f870125fe55cab64c7 (v258).
Fixes #39046.

6 weeks agopkgconf: expose variables for system-alloc-{uid,gid}-min
Markus Boehme [Wed, 27 Aug 2025 20:49:29 +0000 (22:49 +0200)] 
pkgconf: expose variables for system-alloc-{uid,gid}-min

Expose variables for system-alloc-uid-min and system-alloc-gid-min
similar to the UID/GID ranges already exposed for the respective
maximums, and other UID/GID ranges.

6 weeks agonspawn: don't try to connect to D-Bus when it's not necessary (#39045)
Aleksandr Mezin [Mon, 22 Sep 2025 10:59:38 +0000 (13:59 +0300)] 
nspawn: don't try to connect to D-Bus when it's not necessary (#39045)

`runtime_bus` is only used if `!arg_keep_unit`.

`system_bus` is additionally used if `arg_register`.

So for `!arg_register && arg_keep_unit`, none of them should be
necessary, and nspawn should be able to work without any D-Bus
connections.

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

Follow-up for f2f26f1527529b1ea7dcb0dba85456ac98800627

6 weeks agozsh-completion: add completion for `freeze`, `thaw`, `condstop`
雪叶 [Sat, 20 Sep 2025 15:03:35 +0000 (23:03 +0800)] 
zsh-completion: add completion for `freeze`, `thaw`, `condstop`