Commit Graph
86360 Commits
Author SHA1 Message Date
Yu Watanabe 2e8cfb7cef sd-bus: use bus_error_message() at several more places
For CID#1645014, CID#1645016, and CID#1645017.
2026-02-17 17:00:42 +09:00
Yu Watanabe ce6ea42b69 bus-polkit: add one more assertion
For CID#1645013.
2026-02-17 16:39:38 +09:00
Mike Yuan fad273450a socket-util: remove unused {send,receive}_many_fds*()
These were introduced as part of the effort of sd-executor
worker pool (#29566), which never landed due to unsignificant
performance improvement. Let's just remove the unused
helpers. If that work ever gets resurrected they can be
restored from this commit pretty easily.
2026-02-17 14:56:00 +09:00
Yu Watanabe d9e078fe68 oomd: Fix Killed signal reason being lost (#40689)
Emitting "oom" doesn't mesh with the org.freedesktop.oom1.Manager
Killed() API contract, which defines "memory-used" and "memory-pressure"
as possible reasons. Consumers that key off reason thus will either lose
policy attribution or may reject the unknown value completely.

Plumb the reason through so it is visible to consumers.
2026-02-17 14:53:46 +09:00
Chris Down b10e5a60aa oomd: Add regression tests to check Killed notification gives a reason 2026-02-17 14:50:21 +09:00
Chris Down 936d864b0b oomd: Fix Killed signal reason being lost
Emitting "oom" doesn't mesh with the org.freedesktop.oom1.Manager
Killed() API contract, which defines "memory-used" and "memory-pressure"
as possible reasons. Consumers that key off reason thus will either lose
policy attribution or may reject the unknown value completely.

Plumb the reason through so it is visible to consumers.
2026-02-17 14:50:17 +09:00
Daan De Meyer 48c84fe730 nspawn-mount: Use setns() in wipe_fully_visible_api_fs()
namespace_enter() now does a is_our_namespace() check, which requires
/proc on older kernels, which is not available anymore after we call
do_wipe_fully_visible_api_fs() in wipe_fully_visible_api_fs().

Let's just call setns() instead as namespace_enter() is overkill to
enter a single namespace anyway.
2026-02-17 04:55:24 +01:00
Yu Watanabe 710742270b report: enforce metric prefix (#40647)
Addressing
> we should enforce that metrics ids begin with the varlink service name

from #40633
2026-02-17 06:47:50 +09:00
Daan De Meyer 0ad6108c8e mkosi: Set CacheOnly=metadata for test images (#40699)
The default behavior is to sync repository metadata for every image
that does not have a cache and we recently changed behavior to
invalidate
all cached images whenever we decide the repository metadata needs to
be resynced.

In systemd we have two images that are not cached because they use
BaseTrees=
hence set CacheOnly=metadata to explicitly indicate these two images
should never cause a repository metadata if resync even though they are
not cached.
2026-02-16 15:42:35 +01:00
Ivan Kruglov cc14f78c02 report: validate metric name by socket 2026-02-16 05:46:24 -08:00
nikstur 5b193a8e23 meson: read more progs from PATH
Find more progs on PATH instead of hardcoding them.
2026-02-16 14:32:38 +01:00
Daan De Meyer 2a08e31cbd mkosi: Set CacheOnly=metadata for test images
The default behavior is to sync repository metadata for every image
that does not have a cache and we recently changed behavior to invalidate
all cached images whenever we decide the repository metadata needs to
be resynced.

In systemd we have two images that are not cached because they use BaseTrees=
hence set CacheOnly=metadata to explicitly indicate these two images
should never cause a repository metadata if resync even though they are
not cached.
2026-02-16 13:28:22 +01:00
Daan De Meyer 64ccae2a25 mkosi: update mkosi ref to 66d51024b7149f40be4702e84275c936373ace97
* 66d51024b7 man: Update caching section
* 4eac60f168 Remove all cached images if repository metadata will be synced
* 025c6c0150 Move Incremental= to inherited settings in docs
* 427970d8fd Make MakeScriptsExecutable= a multiversal setting
* 53bd2da6fe Look at all CacheOnly= settings to determine if we need to sync metadata
* 114ae558ef config / qemu: add Console=headless
2026-02-16 13:28:13 +01:00
Yu Watanabe 5e0c1f2e1b backlight: also change clamp percentage on ID_BACKLIGHT_CLAMP/ID_LEDS_CLAMP=yes
Follow-up for 4ed1e2ea17.
2026-02-16 21:24:55 +09:00
Yu Watanabe ad3e4af9a7 networkctl: use varlink method to bring up/down interfaces (#40693)
Closes #38538.
Closes #40017.
2026-02-16 20:35:29 +09:00
Yu Watanabe ed6a2eaa31 ask-password-api: several modernizations for ask_password_agent(); use CLEANUP_TMPFILE_AT more (#40631) 2026-02-16 20:07:32 +09:00
Ivan Kruglov b465e848f3 report: rearrange handling connection drop when skipping metrics 2026-02-16 02:34:11 -08:00
Daan De Meyer 4e40c2a515 namespace-util: Merge namespace_enter_delegated() into namespace_enter() (#40669)
There's no need to pass in a boolean to decide whether we use
namespace_enter_delegated() or not. Instead, we can just check if we
have CAP_SYS_ADMIN in our own user namespace. If we don't, then we have
to insist on a child user namespace being passed in and we have to enter
it first to get CAP_SYS_ADMIN as without CAP_SYS_ADMIN we wouldn't be
able
to call setns() in the first place. If we do have CAP_SYS_ADMIN, we can
always enter the other namespaces first before entering the user
namespace.

Additionally, we don't fail anymore if we can't reset the UID/GID since
a
root user might not always be available in every user namespace we might
enter.
2026-02-16 11:26:41 +01:00
r-vdp e271497d97 dns-delegates: add support for setting a firewall mark
This makes it possible to have DNS requests for certain domains routed
differently than normal requests, which is for instance useful when
using policy routing to route traffic over a VPN but DNS requests for
the VPN endpoint itself, should be routed differently.

It doesn't make much sense to configure a firewall mark at the level of
a network interface, but at the level of a DNS delegate it can be very
useful.
2026-02-16 11:09:48 +01:00
Daan De Meyer a5ceab95ab Varlink fixlets and several other follow-ups (#40687) 2026-02-16 11:02:08 +01:00
Daan De Meyer d1e0b59843 oomd: Fix bug where we drop queued kill state on duplicate cgroup (#40690) 2026-02-16 10:52:49 +01:00
Yu Watanabe 067758a3be networkctl: use varlink methods to bring up/down interfaces
Then,
- polkit authentication can be used,
- dynamic configuration engine can be safely stopped before bringing
  down interfaces.

Fixes #38538.
2026-02-16 18:37:17 +09:00
Yu Watanabe 314f93d9d3 networkctl: merge three functions for calling D-Bus methods 2026-02-16 18:37:17 +09:00
Yu Watanabe 63fd8c9b9e networkctl: use parse_interfaces() at one more place 2026-02-16 18:37:17 +09:00
Yu Watanabe 4610a4dc4c networkctl: split out parse_interfaces()
Also, this makes interfaces stored in OrderedSet rather than Set,
so interfaces becomes up/down in the specified order.

This also makes when multiple interfaces are specified, networkctl tries
to up/down all specfied interfaces even if some of them are failed.

Fixes #40017.
2026-02-16 18:37:17 +09:00
Daan De Meyer 211c3c9d41 namespace-util: Merge namespace_enter_delegated() into namespace_enter()
There's no need to pass in a boolean to decide whether we use
namespace_enter_delegated() or not. Instead, we can just check if we
have CAP_SYS_ADMIN in our own user namespace. If we don't, then we have
to insist on a child user namespace being passed in and we have to enter
it first to get CAP_SYS_ADMIN as without CAP_SYS_ADMIN we wouldn't be able
to call setns() in the first place. If we do have CAP_SYS_ADMIN, we can
always enter the other namespaces first before entering the user namespace.

Additionally, we don't fail anymore if we can't reset the UID/GID since a
root user might not always be available in every user namespace we might
enter.
2026-02-16 10:27:02 +01:00
Zbigniew Jędrzejewski-Szmek dae5af119b timesync: fix parsing FallbackNTP= (#40692)
Follow-up for 3745770ae4.
Fixes #40621.
2026-02-16 10:16:21 +01:00
Mike Yuan 389cd296ec core: serialize metrics varlink server as well 2026-02-16 09:44:58 +01:00
Mike Yuan 5561623ef4 core/manager-serialize: discern daemon-reload/reexec via objective 2026-02-16 09:44:58 +01:00
Mike Yuan b166461f82 varlink-serialize: deserialize to correct event priority 2026-02-16 09:44:58 +01:00
Mike Yuan 9676845efa core/varlink: several cleanups for metrics varlink server
Follow-up for bb1ef2edf7

The commit introduced a new "metrics" varlink server, but for
user scope stuff it is not bound anywhere. The copy-pasted
"fresh" handling for deserialization is also essentially
meaningless as metrics_setup_varlink_server() doesn't even report
whether the varlink server is fresh (let alone that no serialization
is being done at all right now). Moreover, currently the event
priority is hardcoded, while event loop and associated priority
assignment ought to be subject to each daemon.

While fixing the mentioned issues I took the chance to restructure
the existing code a bit for readability. Note that serialization
for the metrics server is still missing - it will be tackled
in subsequent commits.
2026-02-16 09:44:58 +01:00
Yu Watanabe ba08fa3230 shared/metrics: add two more assertions 2026-02-16 09:44:58 +01:00
Mike Yuan 702db03034 shared/metrics: name the sd_varlink_server in our usual fashion
This is used for internal reference, in debug logging and such,
hence let's do nothing fancy but instead make it identifiable.
2026-02-16 09:44:57 +01:00
Mike Yuan ba5bd88db3 core/varlink-metrics: suffix metrics methods with _metrics
This is not even the prominent "Describe" method in pid1,
as typically one would be looking for _describe_manager().
2026-02-16 09:44:57 +01:00
Mike Yuan 3cfd35eef9 core/varlink-metrics: include core-forward.h 2026-02-16 09:44:57 +01:00
Mike Yuan fe48347ce6 core/varlink-cgroup: add BindNetworkInterface to varlink CGContext
Follow-up for c1c787651b
2026-02-16 09:44:57 +01:00
Mike Yuan eeead6e177 sd-varlink: fail if a method call wasn't replied to and the callback didn't store it 2026-02-16 09:44:56 +01:00
Mike Yuan 1f9ba6ba73 sd-varlink: take output queue into account in sd_varlink_flush() 2026-02-16 09:44:56 +01:00
Mike Yuan 86ac1083c9 sd-varlink: _reset_fds() should reset fds for the reply being constructed
... (aka pushed_fds), not what's already enqueued to be sent out.
2026-02-16 09:44:56 +01:00
Mike Yuan 959f6923e5 sd-varlink: use free_and_replace at one more place 2026-02-16 09:44:56 +01:00
Mike Yuan 9257690859 sd-varlink: replace manual move_fd() with FORK_PACK_FDS + FORK_CLOEXEC_OFF
Note that this actually matters: we might otherwise clobber
the logging fds reopened when rearranging fd '3'.

While at it, avoid logging from library functions.
2026-02-16 09:44:56 +01:00
Mike Yuan 122bde2c45 sd-varlink: also validate peer ucred for SD_VARLINK_SERVER_MYSELF_ONLY 2026-02-16 09:44:55 +01:00
Mike Yuan 3482e4dd70 sd-varlink: log about client uid that hit connection limit 2026-02-16 09:44:55 +01:00
Mike Yuan e2fb041564 sd-varlink: shorten the code a bit 2026-02-16 09:44:55 +01:00
Mike Yuan 097243cc30 repart: io.systemd.Repart.ListCandidateDevices requires 'more' 2026-02-16 09:44:55 +01:00
Mike Yuan 03023fd12c resolve: io.systemd.Resolve.BrowseServices requires 'more' 2026-02-16 09:44:55 +01:00
Mike Yuan 41e675996d mute-console: io.systemd.MuteConsole requires 'more' 2026-02-16 09:44:54 +01:00
Mike Yuan 09388a6b9e tree-wide: drop redundant check for SD_VARLINK_METHOD_MORE flag
If the IDL declares the method requires 'more' yet the call doesn't
have it set, varlink_idl_validate_method_call() should have rejected
it and the callback shouldn't be reached.
2026-02-16 09:44:54 +01:00
Mike Yuan 42ed373294 varlink-io.systemd.Network: minor coding style cleanups
Follow-up for cf27c70d70
2026-02-16 09:44:54 +01:00
Mike Yuan 05d1cfee90 sd-json: unify JSON_BUILD_PAIR_IN?_ADDR_*
This also swaps family and address params for
plain JSON_BUILD(_PAIR)_IN_ADDR, aligning with
_WITH_STRING flavors.
2026-02-16 09:44:54 +01:00