]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 days agosd-dhcp-lease: use the last hostname option when multiple hostname is specified 39744/head
Yu Watanabe [Sat, 15 Nov 2025 21:10:58 +0000 (06:10 +0900)] 
sd-dhcp-lease: use the last hostname option when multiple hostname is specified

2 days agosd-dhcp-lease: drop ret_ prefixes from the parsers
Yu Watanabe [Sat, 15 Nov 2025 21:09:25 +0000 (06:09 +0900)] 
sd-dhcp-lease: drop ret_ prefixes from the parsers

2 days agonetwork: unify log messages
Yu Watanabe [Sat, 15 Nov 2025 20:59:56 +0000 (05:59 +0900)] 
network: unify log messages

2 days agosd-event: several follow-ups for recent change (#39743)
Daan De Meyer [Sat, 15 Nov 2025 21:47:42 +0000 (22:47 +0100)] 
sd-event: several follow-ups for recent change (#39743)

2 days agotest: add missing assertion 39743/head
Yu Watanabe [Sat, 15 Nov 2025 20:49:33 +0000 (05:49 +0900)] 
test: add missing assertion

Follow-up for 5a5cb6ba50594355734ff58487d2272a86b741b1.
Fixes CID#1643217.

2 days agosd-event: do not ignore result of callbacks
Yu Watanabe [Sat, 15 Nov 2025 20:43:59 +0000 (05:43 +0900)] 
sd-event: do not ignore result of callbacks

Follow-up for 4c8b6d636c92e84f4b40db5656db58f71f397a1d and
6aff6d3ffc8a481bb663ac4dd0cf479845a6e24f.
Fixes CID#1643218 and friends.

3 days agonspawn: Prevent invalid UIDs propagating in bind mounts (#39729)
Yu Watanabe [Sat, 15 Nov 2025 19:46:18 +0000 (04:46 +0900)] 
nspawn: Prevent invalid UIDs propagating in bind mounts (#39729)

Commit 88fce090263ba8944cf491346eae2e8022dfd88d modified the
mount_bind() function, causing it to perform arithmetic on the uid_shift
parameter. However, it performs this arithmetic even when uid_shift was
UID_INVALID, which was not intended. This typically occurred when
mount_custom() was called for a simple bind mount without user
namespaces (and thus no rootidmap mount option).

This arithmetic (e.g., uid_shift + m->destination_uid) then wraps
around, resulting in the invalid ID 4294967295 ((uid_t)-1).

This bug manifests for users running systemd-nspawn with
--link-journal=host and --volatile=yes (but without --private-users),
causing systemd-tmpfiles to fail.

Make mount_bind() robust by checking if uid_shift is valid before using
it in arithmetic. If it is UID_INVALID, it defaults to a shift of 0 for
the ownership calculation, restoring correct behavior for plain bind
mounts while preserving the intended logic for ID-mapped mounts.

Fixes: #39714
3 days agotest: Add nspawn regression test for --link-journal --volatile 39729/head
Chris Down [Fri, 14 Nov 2025 10:08:23 +0000 (18:08 +0800)] 
test: Add nspawn regression test for --link-journal --volatile

3 days agoresolved: add ability for external programs to hook into name resolution (for machine...
Lennart Poettering [Sat, 15 Nov 2025 11:12:37 +0000 (12:12 +0100)] 
resolved: add ability for external programs to hook into name resolution (for machined+networkd to synthesize records) (#39293)

Fixes: #8518
3 days agotest: add workaround for networkd downgrade issue 39293/head
Lennart Poettering [Fri, 14 Nov 2025 16:46:34 +0000 (17:46 +0100)] 
test: add workaround for networkd downgrade issue

3 days agoupdate TODO
Lennart Poettering [Mon, 13 Oct 2025 11:07:15 +0000 (13:07 +0200)] 
update TODO

3 days agounits: let's set a socket name for networkd rtnl socket
Lennart Poettering [Tue, 21 Oct 2025 13:56:25 +0000 (15:56 +0200)] 
units: let's set a socket name for networkd rtnl socket

Let's make our networkd sockets recognizable purely by name. It hink
already for debugging it's a good idea to always set socket names, in
particular for services that have multiple sockets they listen on.

This adds a name to the rtnl socket, which so far missed one. Note that
the C code won't look for it, for compat with older versions, but at
least things are a bit more debuggable.

3 days agonetwork: make use of LocalLeaseDomain= by default
Lennart Poettering [Mon, 13 Oct 2025 09:42:25 +0000 (11:42 +0200)] 
network: make use of LocalLeaseDomain= by default

Let's expose local VMs/containers under ._dhcp by default. Let's also
expose WIFI AP clients under .home.arpa (i.e. the RFC8375 domain for
home networks).

3 days agonetworkd: rename manager_connect_varlink() → manager_varlink_init()
Lennart Poettering [Mon, 13 Oct 2025 10:35:35 +0000 (12:35 +0200)] 
networkd: rename manager_connect_varlink() → manager_varlink_init()

This function doesn't "connect" to Varlink (i.e. it isn't a client) but
it binds a Varlink socket (i.e. it is server), hence let's remove the
verb "connect" from its name. let's copy how machined/resolved name the
counterpart for this function: manager_varlink_init()

3 days agonetworkd: add support for resolved hook for DHCP server
Lennart Poettering [Mon, 13 Oct 2025 07:57:48 +0000 (09:57 +0200)] 
networkd: add support for resolved hook for DHCP server

Let's synthesize DNS RRs for leases handed out by our DHCP server. This
way local VMs can have resolvable hostnames locally.

This does not implement reverse look ups for now. We can add this
later in similar fashion.

3 days agotest: always create networkd mock tmpfs for networkd-test.py
Luca Boccassi [Sat, 15 Nov 2025 00:37:58 +0000 (00:37 +0000)] 
test: always create networkd mock tmpfs for networkd-test.py

Match the behaviour of the other test classes that use sd-run and
always create the mock tmpfs runtime dirs.
This will be needed as the new resolve.hook directory won't exist
on boot but will be needed by the test case.

3 days agosd-dhcp-server: add api to get address from hostname, based on lease data
Lennart Poettering [Mon, 13 Oct 2025 09:25:50 +0000 (11:25 +0200)] 
sd-dhcp-server: add api to get address from hostname, based on lease data

3 days agomachined: implement resolve hook in machined
Lennart Poettering [Thu, 9 Oct 2025 20:01:04 +0000 (22:01 +0200)] 
machined: implement resolve hook in machined

This basically implements nss-myhostname, but natively in
systemd-resolved, so that the logic becomes available also for clients
using the local DNS stub for resolution or the D-Bus or Varlink APIs.

3 days agomachine: minor refactoring, making machine_send_signal() invocations more readable
Lennart Poettering [Thu, 9 Oct 2025 20:19:37 +0000 (22:19 +0200)] 
machine: minor refactoring, making machine_send_signal() invocations more readable

3 days agoresolved: add hook api
Lennart Poettering [Thu, 9 Oct 2025 09:04:58 +0000 (11:04 +0200)] 
resolved: add hook api

This introduces /run/systemd/resolve.hook/ as a new directory that local
(privileged) programs can bind a Varlink socket into. If they do they'll
get a method call for each attempted resolved lookup, which they can
then either process themselves (and generate new records for, or return
errors to block stuff) or let pass so that the regular resolution is
done.

Usecase for this is primarily two things:

1. in machined we can add local resolution of machine names to their IP
   addresses, similar in fashion to nss-mymachines, but working also if
   the non-NSS interfaces to name resolution are used, i.e. the local
   DNS responder. In fact, I think we should eventually remove
   nss-mymachines from our tree, as soon as this code in resolved is
   setlled.

2. in networkd we can add local resolution of names specified in DHCP
   leases we hand out.

But beyond that there should be many other uses, for example people
could write "dns firewalls" with this if they like where they
dynamically block certain names from resolution.

Fixes: #8518
3 days agoMake new sd-path configuration search functionality generic (#39684)
Yu Watanabe [Sat, 15 Nov 2025 01:09:19 +0000 (10:09 +0900)] 
Make new sd-path configuration search functionality generic (#39684)

Reverts systemd/systemd#38680

After taking a closer look I'm not convinced by the approach, see below.

First of all, all other SD_PATH_SEARCH_* are either somewhat generic,
i.e. encode the common prefix for configurations, binaries, etc., or are
subdirectories under systemd/ hence in our own "domain". The
tmpfiles/sysctl/binfmt we don't prefix with "systemd" precisely because
the concept is generic and there're actually other impls of them. A
specific SD_PATH_SEARCH_SYSCTL doesn't fit into our existing scheme.
Instead something along the lines of "SEARCH_SYSTEM_CONFIGURATION" shall
be introduced, and consumers will just suffix
sysctl.d/tmpfiles.d/binfmt.d for the final result.

And secondly, I don't grok why systemd-sysctl now unnecessarily calls
into sd-path to obtain the fixed search path. None of our other tools do
that.

-----------

An alternate approach, SD_PATH_SYSTEM_SEARCH_CONFIGURATION, which does
exactly above, will be introduced instead. It provides a universal
interface for querying any system config with our idiomatic
/etc/:/run/:/usr/local/lib/:/usr/lib/ hierarchy.

3 days agopath-util: add generic `ignore` extension to the hidden files (#39554)
Yu Watanabe [Sat, 15 Nov 2025 01:05:38 +0000 (10:05 +0900)] 
path-util: add generic `ignore` extension to the hidden files (#39554)

3 days agovarlink: say which socket failed to bind in log message
Luca Boccassi [Fri, 14 Nov 2025 23:01:36 +0000 (23:01 +0000)] 
varlink: say which socket failed to bind in log message

Makes it a lot easier to debug failures

3 days agofd-util: do not block O_TMPFILE with -EISDIR (#39736)
Yu Watanabe [Sat, 15 Nov 2025 01:01:19 +0000 (10:01 +0900)] 
fd-util: do not block O_TMPFILE with -EISDIR (#39736)

3 days ago5 TPM tweaks (#39712)
Lennart Poettering [Fri, 14 Nov 2025 22:54:45 +0000 (23:54 +0100)] 
5 TPM tweaks (#39712)

Fixes: #38939
Fixes: #39150
3 days agoupdate TODO
Lennart Poettering [Fri, 14 Nov 2025 22:05:24 +0000 (23:05 +0100)] 
update TODO

3 days agoTry to make TEST-75-RESOLVED less flaky (#39733)
Luca Boccassi [Fri, 14 Nov 2025 21:27:24 +0000 (21:27 +0000)] 
Try to make TEST-75-RESOLVED less flaky (#39733)

These tests unfortunately rely on polling in several areas. In some
cases, it appears the timeouts are too short (e.g. #39602, or
https://github.com/systemd/systemd/actions/runs/19369869943/job/55422626427?pr=39731#logs).

Try to adjust the timeouts to see if this makes things more reliable.

3 days agoman: add pcrproduct to man page header, too 39712/head
Lennart Poettering [Fri, 14 Nov 2025 21:06:53 +0000 (22:06 +0100)] 
man: add pcrproduct to man page header, too

3 days agounits: systemd-pcrproduct.service measures into an NvPCR, fix that in Description=
Lennart Poettering [Thu, 13 Nov 2025 14:33:47 +0000 (15:33 +0100)] 
units: systemd-pcrproduct.service measures into an NvPCR, fix that in Description=

Follow-up for: 0196abbd10331f89bd5ca7abc39225852dff7406

3 days agoman: document that ConditionSecurity=tpm2 means full UEFI/PC Client profile support
Lennart Poettering [Thu, 13 Nov 2025 08:42:43 +0000 (09:42 +0100)] 
man: document that ConditionSecurity=tpm2 means full UEFI/PC Client profile support

TPM2 support is not too useful if the firmware doesn't actually use it
for the boot chain, hence we require the full PC client profile support.
Let's make that clear in the docs.

Fixes: #38939
3 days agoboot: report missing GetActivePcrBanks() call in formware as UINT32_MAX PCR bank...
Lennart Poettering [Thu, 13 Nov 2025 08:30:43 +0000 (09:30 +0100)] 
boot: report missing GetActivePcrBanks() call in formware as UINT32_MAX PCR bank mask

Fixes: #39150
3 days agotpm2-util: use LoaderTpm2ActivePcrBanks efi var when figuring out best+good banks...
Lennart Poettering [Wed, 12 Nov 2025 22:34:52 +0000 (23:34 +0100)] 
tpm2-util: use LoaderTpm2ActivePcrBanks efi var when figuring out best+good banks to use

We nowadays have clear reporting which PCR banks the firmware is using
via LoaderTpm2ActivePcrBanks, hence rely on that.

3 days agounits: measure a separator event into PCR 9 after completing NvPCR initialization
Lennart Poettering [Thu, 13 Nov 2025 13:47:57 +0000 (14:47 +0100)] 
units: measure a separator event into PCR 9 after completing NvPCR initialization

We do this in a separate service (rather than inside of
systemd-tpm2-setup), since we want failures of this measurement to
result in an instant reboot, like for most our measurements.

Failures to initialize nvpcrs, or allocate an SRK are somewhat OK (and
more likely), as long as this separator communicates clearly where they
have to have taken place, if they worked.

3 days agopcrextend: allow setting the event type for the event log on the command line
Lennart Poettering [Thu, 13 Nov 2025 13:46:24 +0000 (14:46 +0100)] 
pcrextend: allow setting the event type for the event log on the command line

This makes the tool more powerful as we can invoke it for any type of
measurement correctly

3 days agotpm2-setup: measure information about NvPCR initialization to PCR 9
Lennart Poettering [Wed, 12 Nov 2025 21:35:30 +0000 (22:35 +0100)] 
tpm2-setup: measure information about NvPCR initialization to PCR 9

This locks down NvPCR initilization a bit more: we'll measure each
initialization of an NvPCR into PCR 9, thus chaining the NvPCRs to the
PCR set. After all NvPCRs are initialized we measure a barrier into PCR
9 as well.

This ensures that later additions of NvPCRs are clearly recognizable and
distuingishable from those done at boot.

3 days agotpm2-util: add missing entry in string table
Lennart Poettering [Wed, 12 Nov 2025 21:34:27 +0000 (22:34 +0100)] 
tpm2-util: add missing entry in string table

Follow-up for: e5a2e7866572614e66cbf6c1d3969128562d9552

3 days agofd-util: do not block O_TMPFILE with -EISDIR 39736/head
Mike Yuan [Fri, 14 Nov 2025 20:32:51 +0000 (21:32 +0100)] 
fd-util: do not block O_TMPFILE with -EISDIR

Follow-up for 7cf4f075670a81babf1501f063f6841cc4e866dd

3 days agofs-util: simplify open_parent_at() a bit
Mike Yuan [Fri, 14 Nov 2025 20:36:16 +0000 (21:36 +0100)] 
fs-util: simplify open_parent_at() a bit

Let's refrain from specifying any access mode when opening
a directory, which matches our usual style and allows us
to drop one condition.

4 days agomusl: stdio: check if stream is writable earlier in fputs() and friends
Yu Watanabe [Thu, 13 Nov 2025 04:40:19 +0000 (13:40 +0900)] 
musl: stdio: check if stream is writable earlier in fputs() and friends

4 days agotest: adjust timeouts for testcase_15_wait_online_dns 39733/head
Nick Rosbrook [Fri, 14 Nov 2025 19:13:07 +0000 (14:13 -0500)] 
test: adjust timeouts for testcase_15_wait_online_dns

Do not set a timeout on the wait-online call, since there are timeout
calls later that will prevent the test from blocking forever. Increase
those timeout calls for slower CI runs.

4 days agotest: increase timeout waiting for zone DS records setup
Nick Rosbrook [Fri, 14 Nov 2025 18:21:02 +0000 (13:21 -0500)] 
test: increase timeout waiting for zone DS records setup

This test is flaky on the infrastructure due to this setup step timing
out. As a naive step, just increase the timeout to 60s.

Part 1 of #39602

4 days agomusl: introduce two wrappers (#39700)
Yu Watanabe [Fri, 14 Nov 2025 19:18:48 +0000 (04:18 +0900)] 
musl: introduce two wrappers (#39700)

4 days agocore: add varlink Reload/Reexecute methods (#39561)
Yu Watanabe [Fri, 14 Nov 2025 19:17:01 +0000 (04:17 +0900)] 
core: add varlink Reload/Reexecute methods (#39561)

Same as the D-Bus ones

4 days agotest: wait for interface to come online before checking DNS scopes
Nick Rosbrook [Fri, 14 Nov 2025 14:37:21 +0000 (09:37 -0500)] 
test: wait for interface to come online before checking DNS scopes

The current test is flaky because it creates a new interface definition,
calls networkctl reload, and then calls resolvectl show-cache. If
resolved has not received the changes and setup the DNS scopes for the
interface, show-cache will be empty for that interface.

Part 2 of #39602

4 days agotree-wide: use SD_JSON_BUILD_PAIR_* macros if possible (#39732)
Yu Watanabe [Fri, 14 Nov 2025 19:02:51 +0000 (04:02 +0900)] 
tree-wide: use SD_JSON_BUILD_PAIR_* macros if possible (#39732)

4 days agomusl: make strtoll() accept strings start with dot 39700/head
Yu Watanabe [Tue, 9 Sep 2025 00:10:44 +0000 (09:10 +0900)] 
musl: make strtoll() accept strings start with dot

glibc accepts strings start with '.' and returns 0, but musl refuses
them. Let's accept them, as our code assumes the function accept such
strings.

4 days agomusl: test-bus-error: drop ._need_free flag checks
Yu Watanabe [Thu, 13 Nov 2025 23:26:47 +0000 (08:26 +0900)] 
musl: test-bus-error: drop ._need_free flag checks

Its value depends on how strerror_r() implemented, and the
implementations of the function in glibc and musl are actually
different. Let's drop the checks.

4 days agomusl: introduce GNU specific version of strerror_r()
Yu Watanabe [Tue, 24 Jan 2023 07:39:46 +0000 (23:39 -0800)] 
musl: introduce GNU specific version of strerror_r()

musl provides XSI compliant strerror_r(), and it is slightly different
from the one by glibc.
Let's introduce a tiny wrapper to convert XSI strerror_r() to GNU one.

The wrapper also patches musl's spurious catchall error message.

4 days agodocs: initial version of varlink guideline
Ivan Kruglov [Tue, 11 Nov 2025 19:22:20 +0000 (11:22 -0800)] 
docs: initial version of varlink guideline

4 days agoelf-util: prefer using SD_JSON_BUILD_PAIR_* macros 39732/head
Jelle van der Waa [Fri, 14 Nov 2025 14:47:15 +0000 (15:47 +0100)] 
elf-util: prefer using SD_JSON_BUILD_PAIR_* macros

No functional change, just refactoring.

4 days agossh-generator: prefer using SD_JSON_BUILD_PAIR_STRING
Jelle van der Waa [Fri, 14 Nov 2025 14:43:30 +0000 (15:43 +0100)] 
ssh-generator: prefer using SD_JSON_BUILD_PAIR_STRING

No functional change, just refactoring.

4 days agouserdb: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR(
Jelle van der Waa [Fri, 14 Nov 2025 12:56:22 +0000 (13:56 +0100)] 
userdb: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR(

No functional change, just refactoring.

4 days agosd-json: prefer using SD_JSON_BUILD_PAIR_UNSIGNED
Jelle van der Waa [Fri, 14 Nov 2025 12:54:31 +0000 (13:54 +0100)] 
sd-json: prefer using SD_JSON_BUILD_PAIR_UNSIGNED

No functional change, just refactoring.

4 days agosd-event: Move SOURCE_POST check into mark_post_sources_pending()
Daan De Meyer [Fri, 14 Nov 2025 11:14:44 +0000 (12:14 +0100)] 
sd-event: Move SOURCE_POST check into mark_post_sources_pending()

Rename to maybe_mark_post_sources_pending() as well to match the new
behavior.

Follow up for 4c8b6d636c92e84f4b40db5656db58f71f397a1d

4 days agosd-event: Add comment in event_source_offline() for memory pressure
Daan De Meyer [Fri, 14 Nov 2025 11:11:21 +0000 (12:11 +0100)] 
sd-event: Add comment in event_source_offline() for memory pressure

Follow up for d0ddb0aafb2c678382aad04ff6eafaac86749857

4 days agoThree new sd-event features + various fixes (#39608)
Daan De Meyer [Fri, 14 Nov 2025 11:05:12 +0000 (12:05 +0100)] 
Three new sd-event features + various fixes (#39608)

4 days agolog-context: Don't add log context if value is NULL 39608/head
Daan De Meyer [Wed, 5 Nov 2025 22:45:30 +0000 (23:45 +0100)] 
log-context: Don't add log context if value is NULL

This avoids if conditions at the callsite which mess up stack based
lifetimes.

4 days agobasic-forward: Add WaitFlags forward decl
Daan De Meyer [Thu, 6 Nov 2025 13:30:41 +0000 (14:30 +0100)] 
basic-forward: Add WaitFlags forward decl

4 days agosd-event: Make sure iterations of defer and exit sources are updated
Daan De Meyer [Thu, 13 Nov 2025 21:15:01 +0000 (22:15 +0100)] 
sd-event: Make sure iterations of defer and exit sources are updated

Defer and exit event sources are marked pending once when they are added
and never again afterwards. This means their pending_iteration is never
incremented after they are initially added, which breaks fairness among
event sources with equal priority which depend on the pending_iteration
variable getting updated in source_set_pending(). To fix this, let's assign
iterations for defer and exit sources in source_dispatch() instead so that
those get their pending_iteration updated as well.

4 days agosd-event: Add exit-on-idle support
Daan De Meyer [Wed, 12 Nov 2025 16:58:17 +0000 (17:58 +0100)] 
sd-event: Add exit-on-idle support

Sometimes it's hard to assign responsibility to a specific event source
for exiting when there's no more work to be done. So let's add exit-on-idle
support where we exit when there are no more event sources.

4 days agonspawn: Prevent invalid UIDs propagating in bind mounts
Chris Down [Fri, 14 Nov 2025 10:04:24 +0000 (18:04 +0800)] 
nspawn: Prevent invalid UIDs propagating in bind mounts

Commit 88fce09 modified the mount_bind() function, causing it to perform
arithmetic on the uid_shift parameter. However, it performs this
arithmetic even when uid_shift was UID_INVALID, which was not intended.
This typically occurred when mount_custom() was called for a simple bind
mount without user namespaces (and thus no rootidmap mount option).

This arithmetic (e.g., uid_shift + m->destination_uid) then wraps
around, resulting in the invalid ID 4294967295 ((uid_t)-1).

This bug manifests for users running systemd-nspawn with
--link-journal=host and --volatile=yes (but without --private-users),
causing systemd-tmpfiles to fail.

Make mount_bind() robust by checking if uid_shift is valid before using
it in arithmetic. If it is UID_INVALID, it defaults to a shift of 0 for
the ownership calculation, restoring correct behavior for plain bind
mounts while preserving the intended logic for ID-mapped mounts.

Fixes: #39714
4 days agorun0: Make --same-root-dir available for run0
Daan De Meyer [Fri, 14 Nov 2025 08:10:18 +0000 (09:10 +0100)] 
run0: Make --same-root-dir available for run0

This enables running something like
"mkosi box -- run0 --empower --same-root-dir -E PATH" to get an
empowered session as the current user within the "mkosi box" environment.

4 days agosd-event: Allow passing WNOWAIT to sd_event_add_child()
Daan De Meyer [Thu, 6 Nov 2025 13:30:06 +0000 (14:30 +0100)] 
sd-event: Allow passing WNOWAIT to sd_event_add_child()

This allows doing the reaping outside of the callback, we'll use this
when adding fibers in a later commit.

4 days agosd-event: Drop faulty shortcut
Daan De Meyer [Thu, 13 Nov 2025 21:33:11 +0000 (22:33 +0100)] 
sd-event: Drop faulty shortcut

We can't take this shortcut, as we might have to drop the
EPOLLONESHOT flag for some event sources, so drop the shortcut.

4 days agosd-event: Only register memory presure if write buffer size is zero
Daan De Meyer [Fri, 14 Nov 2025 09:28:43 +0000 (10:28 +0100)] 
sd-event: Only register memory presure if write buffer size is zero

As documented in sd_event_add_memory_pressure(), we can only add
the memory pressure fd to epoll once we've written the watch string,
so make sure we don't register the memory pressure in
event_source_online() until we've written the watch string.

4 days agosd-event: Mark post sources as pending after dispatching
Daan De Meyer [Thu, 6 Nov 2025 09:20:49 +0000 (10:20 +0100)] 
sd-event: Mark post sources as pending after dispatching

More post event sources might get added during dispatching, we want
to make sure those become pending as well if we're dispatching a non-post
event source.

4 days agotest-cgroup-util: Skip test on ESTALE
Daan De Meyer [Thu, 6 Nov 2025 19:56:53 +0000 (20:56 +0100)] 
test-cgroup-util: Skip test on ESTALE

The kernel converts a bunch of errors to ESTALE in the open_by_handle_at()
codepath so we treat it as missing privs but it could be absolutely
anything really.

4 days agotest-rm-rf: Check capabilities
Daan De Meyer [Thu, 6 Nov 2025 19:21:55 +0000 (20:21 +0100)] 
test-rm-rf: Check capabilities

The assertion will succeed if we have the right capability, causing the
test to fail.

4 days agotest-id128: Check capability instead of uid
Daan De Meyer [Thu, 6 Nov 2025 19:10:39 +0000 (20:10 +0100)] 
test-id128: Check capability instead of uid

4 days agointegritysetup: Add support for hmac-sha512 and wrapped key HMAC algorithms phmac...
Luca Boccassi [Fri, 14 Nov 2025 00:12:34 +0000 (00:12 +0000)] 
integritysetup: Add support for hmac-sha512 and wrapped key HMAC algorithms phmac-sha256 and phmac-sha512 (#39719)

Currently the only supported integrity algorithm using HMAC is
`hmac-sha256`. Add `hmac-sha512` to the list of supported algorithms as
well.

Also add the `PHMAC` integrity algorithm to the list of supported
algorithms. The `PHMAC` algorithm is like the regular HMAC algorithm,
but it takes a wrapped key as input. A key for the `PHMAC` algorithm is
an opaque key blob, who's physical size has nothing to do with the
cryptographic size. Such a wrapped key can for example be a HSM
protected key. Currently PHMAC is only available for the s390x
architecture (Linux on IBM Z).

Support for PHMAC has just been added to the cryptsetup project via MR
https://gitlab.com/cryptsetup/cryptsetup/-/merge_requests/693 by commit

https://gitlab.com/cryptsetup/cryptsetup/-/commit/296eb39c60bd85228930caaea4bb1d2a766b7544

To allow automatic opening of integrity protected volumes that use PHMAC
via `/etc/integritytab`, this change in systemd's integritysetup tool is
needed as well.

4 days agosd-dhcp-server: Add Hostname= option to static leases
Chris Down [Sun, 9 Nov 2025 16:59:59 +0000 (00:59 +0800)] 
sd-dhcp-server: Add Hostname= option to static leases

This adds a new `Hostname=` option to the [DHCPServerStaticLease]
section in .network files, allowing an administrator to assign a
specific hostname to a client receiving a static lease.

We automatically select the correct DHCP option to use based on the
format of the provided string:

- Single DNS labels are sent as Option 12.
- Names with multiple DNS labels are sent as Option 81 in wire format.

Fixes: #39634
4 days agomusl: add several missing symbols (#39701)
Yu Watanabe [Thu, 13 Nov 2025 22:49:16 +0000 (07:49 +0900)] 
musl: add several missing symbols (#39701)

4 days agoThree follow-ups for recent changes (#39724)
Yu Watanabe [Thu, 13 Nov 2025 22:48:47 +0000 (07:48 +0900)] 
Three follow-ups for recent changes (#39724)

5 days agostdio-bridge: remove unreachable return 39724/head
Mike Yuan [Thu, 13 Nov 2025 20:08:50 +0000 (21:08 +0100)] 
stdio-bridge: remove unreachable return

5 days agorun: refuse --root-directory= in --scope mode
Mike Yuan [Thu, 13 Nov 2025 20:09:52 +0000 (21:09 +0100)] 
run: refuse --root-directory= in --scope mode

As discussed in #39669, let's reject this for now.

5 days agoefivars: insert a newline below fstat() call
Mike Yuan [Thu, 13 Nov 2025 20:17:08 +0000 (21:17 +0100)] 
efivars: insert a newline below fstat() call

5 days agomusl: add several missing statx macros 39701/head
Yu Watanabe [Sat, 21 Jun 2025 15:38:58 +0000 (00:38 +0900)] 
musl: add several missing statx macros

glibc's sys/stat.h includes linux/stat.h, and we have copy of it from
the latest kernel, hence all new flags are always defined.
However, musl's sys/stat.h does not include linux/stat.h, and moreover,
they conflict with each other, hence we cannot include both header
simultaneously. Let's define missing macros to support musl.

5 days agomusl: add missing FTW_CONTINUE macro
Chen Qi [Mon, 25 Feb 2019 07:00:06 +0000 (15:00 +0800)] 
musl: add missing FTW_CONTINUE macro

This is to avoid build failures like below for musl.

  test-recurse-dir.c:23:24: error: ‘FTW_CONTINUE’ undeclared

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
5 days agomusl: replace netinet/if_ether.h with our own implementation
Yu Watanabe [Mon, 23 Jun 2025 07:08:37 +0000 (16:08 +0900)] 
musl: replace netinet/if_ether.h with our own implementation

musl's netinet/if_ether.h conflicts with linux/if_ether.h.
The reimplementation is mostly equivalent with what glibc does.

5 days agomusl: provide several missing definitions for prctl()
Yu Watanabe [Mon, 23 Jun 2025 07:00:21 +0000 (16:00 +0900)] 
musl: provide several missing definitions for prctl()

5 days agomusl: introduce dummy function for gnu_get_libc_version()
Yu Watanabe [Sun, 8 Jun 2025 01:07:54 +0000 (10:07 +0900)] 
musl: introduce dummy function for gnu_get_libc_version()

As the header gnu/libc-version.h and gnu_get_libc_version() function
are glibc specific, and musl does not provide them.

5 days agomusl: introduce dummy functions for mallinfo(), malloc_info(), and malloc_trim()
Yu Watanabe [Mon, 9 Jun 2025 15:40:59 +0000 (00:40 +0900)] 
musl: introduce dummy functions for mallinfo(), malloc_info(), and malloc_trim()

These functions are not provided by musl.

5 days agomusl: introduce dummy gshadow header file for userdb
Yu Watanabe [Sun, 21 Sep 2025 06:24:06 +0000 (15:24 +0900)] 
musl: introduce dummy gshadow header file for userdb

Even 'gshadow' meson option is disabled, src/shared/userdb.c and
src/shared/user-record-nss.c include gshadow.h unconditionally.
Let's introduce dummy header to make them compiled gracefully.

5 days agohwdb: add entry for Acer Switch One 10 (SW1-011) (#39716)
Bastian Almendras [Thu, 13 Nov 2025 19:33:47 +0000 (16:33 -0300)] 
hwdb: add entry for Acer Switch One 10 (SW1-011) (#39716)

Add the correct rotation for Acer Switch One 10 (SW1-011)

5 days agogpt-auto-generator: fix typo in crypttab option name
Antonio Alvarez Feijoo [Thu, 13 Nov 2025 15:25:19 +0000 (16:25 +0100)] 
gpt-auto-generator: fix typo in crypttab option name

Spotted while debugging a ParticleOS build:

```
Nov 13 14:44:32 localhost systemd-cryptsetup[591]: Encountered unknown /etc/crypttab option 'tpm2-measure-slot-nvpcr=cryptsetup', ignoring.
```

Follow-up for e5a2e7866572614e66cbf6c1d3969128562d9552

5 days agomusl: test: several random fixlets for unit tests
Yu Watanabe [Tue, 9 Sep 2025 04:34:31 +0000 (13:34 +0900)] 
musl: test: several random fixlets for unit tests

5 days agocore: record transactions that have seen ordering cycles and expose them via IPC...
Yu Watanabe [Thu, 13 Nov 2025 15:41:46 +0000 (00:41 +0900)] 
core: record transactions that have seen ordering cycles and expose them via IPC (#39210)

Closes #3829.

5 days agoMake systemd stdio bridge quiet (#39718)
Yu Watanabe [Thu, 13 Nov 2025 15:39:15 +0000 (00:39 +0900)] 
Make systemd stdio bridge quiet (#39718)

5 days agoefivarfs readv() size fixes and more (#39715)
Yu Watanabe [Thu, 13 Nov 2025 15:38:29 +0000 (00:38 +0900)] 
efivarfs readv() size fixes and more (#39715)

Fixes: #39695
5 days agotree-wide: assorted fixes/workarounds for supporting musl (#39687)
Yu Watanabe [Thu, 13 Nov 2025 15:16:50 +0000 (00:16 +0900)] 
tree-wide: assorted fixes/workarounds for supporting musl (#39687)

5 days agointegritysetup: Add PHMAC algorithm to list of known algorithms 39719/head
Ingo Franzki [Mon, 4 Mar 2024 08:26:18 +0000 (09:26 +0100)] 
integritysetup: Add PHMAC algorithm to list of known algorithms

Add the PHMAC integrity algorithm to the list of supported algorithms.

The PHMAC algorithm is like the regular HMAC algorithm, but it takes a wrapped key
as input. A key for the PHMAC algorithm is an opaque key blob, who's physical size
has nothing to do with the cryptographic size. Currently PHMAC is only available
for the s390x architecture.

5 days agosd-bus: Pass --user and --quiet to systemd-stdio-bridge if local 39718/head
Daan De Meyer [Sun, 2 Nov 2025 13:17:36 +0000 (14:17 +0100)] 
sd-bus: Pass --user and --quiet to systemd-stdio-bridge if local

If we're switching users but not entering a container, then we can
assume that new switches for systemd-stdio-bridge are available, so
make use of them in that case.

5 days agostdio-bridge: Fix --user
Daan De Meyer [Sun, 2 Nov 2025 16:52:14 +0000 (17:52 +0100)] 
stdio-bridge: Fix --user

If --user was specified we would still try to use the system bus
address.

5 days agostdio-bridge: Add --quiet option
Daan De Meyer [Sun, 2 Nov 2025 12:52:15 +0000 (13:52 +0100)] 
stdio-bridge: Add --quiet option

When we use stdio-bridge via sd-bus to connect to a bus of a different
user, container or host, stdio-bridge should not log at error level but
at debug level as it's invoked by the sd-bus library and sd-bus should
generally not log above debug level.

We can't actually use the --quiet option yet as that would break connecting
to hosts running older versions of systemd but let's already add the option
now in preparation for a brighter future.

5 days agobus-wait-for-jobs: Make sure we always debug log
Daan De Meyer [Sat, 1 Nov 2025 21:15:36 +0000 (22:15 +0100)] 
bus-wait-for-jobs: Make sure we always debug log

If we're not logging at a higher priority level, let's still log
at debug log level to help with debugging.

5 days agoshared: Forward declare InstallChange in shared-forward.h
Daan De Meyer [Sat, 1 Nov 2025 21:13:27 +0000 (22:13 +0100)] 
shared: Forward declare InstallChange in shared-forward.h

5 days agotree-wide: fix lseek() parameter order 39715/head
Lennart Poettering [Thu, 13 Nov 2025 13:15:33 +0000 (14:15 +0100)] 
tree-wide: fix lseek() parameter order

The offset must be specified first, 'whence' second. Fix that.

Except for one case this fix doesn't actually fix any real bug, since
SEEK_SET is defined as 0 anyway, hence the swapped arguments have no
effect.

The one exception is the MTD smartmedia code, which I guess indicates
that noone has been using that hw anymore in a long time?

5 days agoefivars: seek back to beginning in each efi_get_variable() loop
Lennart Poettering [Thu, 13 Nov 2025 11:35:36 +0000 (12:35 +0100)] 
efivars: seek back to beginning in each efi_get_variable() loop

We try to read again from the beginning, hence let's seek back.
Apparently efivarfs doesn't strictly require this, but it's really weird
that it doesn't.

5 days agoefivars: validate we are actually talking about a regular file
Lennart Poettering [Thu, 13 Nov 2025 11:33:12 +0000 (12:33 +0100)] 
efivars: validate we are actually talking about a regular file

We already have the stat data, let's actually check if things are
alright before relying on .st_size

5 days agoefivars: fix size checks in efi_get_variable()
Lennart Poettering [Thu, 13 Nov 2025 11:14:34 +0000 (12:14 +0100)] 
efivars: fix size checks in efi_get_variable()

writev() returns the full size, not just the payload size, hence always
add sizeof(attr) where necessary.

Let's also change a couple of "4" into sizeof(attr) all over the place,
to make clear what they are about.

Fixes: #39695
Follow-up for: 9db9d6806e398465a6366dfc5bdde2e24338ac29