]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
12 months agonspawn: several follow-ups for recent changes (#35146)
Yu Watanabe [Thu, 14 Nov 2024 15:12:40 +0000 (00:12 +0900)] 
nspawn: several follow-ups for recent changes (#35146)

Closes #35116.

12 months agonetwork/ndisc: fix coalescing of ndisc routes when multiple router exists (#35119)
Yu Watanabe [Thu, 14 Nov 2024 15:10:22 +0000 (00:10 +0900)] 
network/ndisc: fix coalescing of ndisc routes when multiple router exists (#35119)

Fixes #33470.

12 months agoprocess-util: refuse FORK_DETACH + FORK_DEATHSIG_*
Mike Yuan [Mon, 11 Nov 2024 18:38:36 +0000 (19:38 +0100)] 
process-util: refuse FORK_DETACH + FORK_DEATHSIG_*

There's no synchoronization between the intermediate process
and the double-forked child, and the semantics are not useful.
Refuse such combination.

12 months agoasync: block SIGTERM in asynchronous_rm_rf()
Mike Yuan [Mon, 11 Nov 2024 18:11:38 +0000 (19:11 +0100)] 
async: block SIGTERM in asynchronous_rm_rf()

See justifications at https://github.com/systemd/systemd/pull/32235#issuecomment-2062327783

12 months agonetwork/netdev: follow-ups for reloading .netdev files (#34979)
Luca Boccassi [Thu, 14 Nov 2024 11:36:26 +0000 (11:36 +0000)] 
network/netdev: follow-ups for reloading .netdev files (#34979)

Follow-ups for #34909.

12 months agoTEST-13-NSPAWN: add test case for /dev/net/tun 35146/head
Yu Watanabe [Thu, 14 Nov 2024 09:08:35 +0000 (18:08 +0900)] 
TEST-13-NSPAWN: add test case for /dev/net/tun

For issue #35116.

12 months agonspawn: ignore failure in creating /dev/net/tun when --private-network is unspecified
Yu Watanabe [Wed, 13 Nov 2024 04:36:11 +0000 (13:36 +0900)] 
nspawn: ignore failure in creating /dev/net/tun when --private-network is unspecified

Follow-up for efedb6b0f3cff37950112fd37cb750c16d599bc7.
Closes #35116.

12 months agonspawn: split out copy_devnode_one() and bind_mount_devnode() from copy_devnodes()
Yu Watanabe [Wed, 13 Nov 2024 04:17:42 +0000 (13:17 +0900)] 
nspawn: split out copy_devnode_one() and bind_mount_devnode() from copy_devnodes()

While doing that, even if mknod() failed, we anyway try to fall back to
use bind mount if arg_uid_shift == 0.

Mostly no functional change, just refactoring and preparation for later commit.

12 months agonspawn: silence warning about failure in getting fuse version
Yu Watanabe [Wed, 13 Nov 2024 04:42:03 +0000 (13:42 +0900)] 
nspawn: silence warning about failure in getting fuse version

Follow-up for dc3223919f663b7c8b8d8d1d6072b4487df7709b.

If nspawn is invoked with DevicePolicy= but DeviceAllow= does not
contain /dev/fuse, nspawn will fail to get fuse version with -EPERM.
Let's silence the warning in that case.

12 months agoboot/stub: allocate pages for combined initrds below 4GiB only on x86 (#35149)
andre4ik3 [Thu, 14 Nov 2024 04:20:09 +0000 (08:20 +0400)] 
boot/stub: allocate pages for combined initrds below 4GiB only on x86 (#35149)

Outside of x86, some machines (e.g. Apple silicon, AMD Opteron A1100)
have physical memory mapped above 4GiB, meaning this allocation will
fail, causing the entire boot process to fail on these machines.

This commit makes it so that the below-4GB address space allocation
requirement is only set on x86 platforms, and not on other platforms
(that don't have the specific Linux x86 boot protocol), thereby fixing
boot on those that have no memory mapped below 4GiB in their address
space.

Tested on an Apple silicon M1 laptop and an AMD x86_64 desktop tower.

Fixes: #35026
12 months agofetch-distro: use git log --first-parent and update debian commit (#35151)
Yu Watanabe [Thu, 14 Nov 2024 03:15:38 +0000 (12:15 +0900)] 
fetch-distro: use git log --first-parent and update debian commit (#35151)

12 months agologind-session: be more specific about session_kill() errors, plus minor fixes for...
Yu Watanabe [Thu, 14 Nov 2024 03:04:30 +0000 (12:04 +0900)] 
logind-session: be more specific about session_kill() errors, plus minor fixes for sd_bus_error handling (#35150)

12 months agotmpfiles.d/meson.build: two minor tweaks (#35153)
Yu Watanabe [Thu, 14 Nov 2024 03:02:34 +0000 (12:02 +0900)] 
tmpfiles.d/meson.build: two minor tweaks (#35153)

12 months agonetwork/ndisc: dynamically configure nexthops when routes with gateway are requested 35119/head
Yu Watanabe [Mon, 11 Nov 2024 17:13:04 +0000 (02:13 +0900)] 
network/ndisc: dynamically configure nexthops when routes with gateway are requested

Previously, when multiple routers send RAs with the same preference,
then the kernel merges routes with the same gateway address:
===
default proto ra metric 1024 expires 595sec pref medium
        nexthop via fe80::200:10ff:fe10:1060 dev enp0s9 weight 1
        nexthop via fe80::200:10ff:fe10:1061 dev enp0s9 weight 1
===
This causes IPv6 Conformance Test v6LC.2.2.11 failure, as reported in #33470.

To avoid the coalescing issue, we can use nexthop, as suggested by Ido Schimmel:
https://lore.kernel.org/netdev/ZytjEINNRmtpadr_@shredder/
> BTW, you can avoid the coalescing problem by using the nexthop API.
> # ip nexthop add id 1 via fe80::200:10ff:fe10:1060 dev enp0s9
> # ip -6 route add default nhid 1 expires 600 proto ra
> # ip nexthop add id 2 via fe80::200:10ff:fe10:1061 dev enp0s9
> # ip -6 route append default nhid 2 expires 600 proto ra
> # ip -6 route
> fe80::/64 dev enp0s9 proto kernel metric 256 pref medium
> default nhid 1 via fe80::200:10ff:fe10:1060 dev enp0s9 proto ra metric 1024 expires 563sec pref medium
> default nhid 2 via fe80::200:10ff:fe10:1061 dev enp0s9 proto ra metric 1024 expires 594sec pref medium

Fixes #33470.

Suggested-by: Ido Schimmel <idosch@idosch.org>
12 months agonetwork/nexthop: serialize/deserialize nexthops
Yu Watanabe [Mon, 11 Nov 2024 16:52:07 +0000 (01:52 +0900)] 
network/nexthop: serialize/deserialize nexthops

12 months agonetwork/nexthop: preparation for dynamically configuring nexthops
Yu Watanabe [Mon, 11 Nov 2024 07:19:26 +0000 (16:19 +0900)] 
network/nexthop: preparation for dynamically configuring nexthops

Preparation for later commits.

12 months agonetwork: serialize and deserialize current configuration (#34989)
Yu Watanabe [Thu, 14 Nov 2024 02:59:44 +0000 (11:59 +0900)] 
network: serialize and deserialize current configuration (#34989)

Replaces #34963.

Fixes #26602.
Fixes #32569.

12 months agotest-network: update KeepConfiguration=dhcp -> dynamic 34989/head
Yu Watanabe [Tue, 5 Nov 2024 03:17:51 +0000 (12:17 +0900)] 
test-network: update KeepConfiguration=dhcp -> dynamic

12 months agoman/network: update documentation for KeepConfiguration=
Yu Watanabe [Tue, 5 Nov 2024 03:15:04 +0000 (12:15 +0900)] 
man/network: update documentation for KeepConfiguration=

12 months agonetwork: rename KeepConfiguration=dhcp -> dynamic
Yu Watanabe [Tue, 5 Nov 2024 03:14:01 +0000 (12:14 +0900)] 
network: rename KeepConfiguration=dhcp -> dynamic

KeepConfiguration=dhcp keeps not only DHCP configurations but
also SLAAC or IPV4LL. Let's rename the value to 'dynamic'.

12 months agonetwork/ipv4ll: use a foreign IPv4LL address when KeepConfiguration=dhcp
Yu Watanabe [Wed, 6 Nov 2024 18:40:04 +0000 (03:40 +0900)] 
network/ipv4ll: use a foreign IPv4LL address when KeepConfiguration=dhcp

This is similar to what we do for DHCPv4 address, but for IPv4LL
address.

12 months agonetwork: keep all dynamically acquired configurations when KeepConfiguration=dhcp...
Yu Watanabe [Wed, 6 Nov 2024 18:43:50 +0000 (03:43 +0900)] 
network: keep all dynamically acquired configurations when KeepConfiguration=dhcp-on-stop

By the previous commit, configuration source of addresses and routes are
saved on stop and restored on start. Hence, we can keep dynamic
configurations on stop.

Co-authored-by: Jian Zhang <zhangjian.3032@bytedance.com>
12 months agonetwork: introduce manager_serialize()/deserialize()
Yu Watanabe [Fri, 1 Nov 2024 21:03:09 +0000 (06:03 +0900)] 
network: introduce manager_serialize()/deserialize()

Currently, only configuration sources and providers of addresses and
routes are serialized/deserialized.
This should mostly not change behavior, as dynamic (except for DHCPv4)
configurations will be dropped before stopping networkd, and for DHCPv4
protocol, we have already had another logic to handle DHCPv4
configurations.
Preparation for later commits.

12 months agonetworkd-test.py: show current status when wait-online failed 34979/head
Yu Watanabe [Tue, 12 Nov 2024 10:43:57 +0000 (19:43 +0900)] 
networkd-test.py: show current status when wait-online failed

For easier debugging on failure.

12 months agotest-network: add tests for reloading .netdev files for independent netdevs
Yu Watanabe [Fri, 8 Nov 2024 16:26:29 +0000 (01:26 +0900)] 
test-network: add tests for reloading .netdev files for independent netdevs

12 months agonetwork/tuntap: manage tun/tap fds by manager
Yu Watanabe [Fri, 8 Nov 2024 17:48:17 +0000 (02:48 +0900)] 
network/tuntap: manage tun/tap fds by manager

Otherwise, when a .netdev file for tun or tap netdev is updated,
reloading the file leaks the previous file descriptor.

12 months agonetwork/bond: do not update several parameters if already up or has slaves
Yu Watanabe [Fri, 8 Nov 2024 16:46:05 +0000 (01:46 +0900)] 
network/bond: do not update several parameters if already up or has slaves

Some bonding parameters cannot be updated when the netdev is already up
or already has at least one slave interface.

12 months agonetwork/netdev: do not try to update if not supported
Yu Watanabe [Sun, 10 Nov 2024 00:51:32 +0000 (09:51 +0900)] 
network/netdev: do not try to update if not supported

Some netdevs cannot update there properties after created.
Let's skip requests in that case.

12 months agonetwork/netdev: fix counter handling if request is cancelled
Yu Watanabe [Mon, 11 Nov 2024 02:13:39 +0000 (11:13 +0900)] 
network/netdev: fix counter handling if request is cancelled

Follow-up for 1003093604661bd984574889167f2ff4dfd6209c.

If a netdev is detached for some reasons, then previously the request
was simply cancelled, and the underlying interface never enter the
configured state, as the 'stacked_netdevs_created' flag never set.

This makes the counter decremented manually by the function, and set the
flag. So, the underlying interface can eter the configured state.

12 months agonetwork/netdev: always queue request of creating netdev then process it later
Yu Watanabe [Thu, 31 Oct 2024 19:56:12 +0000 (04:56 +0900)] 
network/netdev: always queue request of creating netdev then process it later

After PR #34909, networkd tries to update an existing netdev interface if
possible. But, when .netdev files are loaded on start, we have not
enumerate interfaces, so we do not know if the corresponding interface
exists or not. Let's delay processing request a bit.

12 months agonetwork/netdev: enter ready state only when it is created by us
Yu Watanabe [Fri, 8 Nov 2024 15:58:29 +0000 (00:58 +0900)] 
network/netdev: enter ready state only when it is created by us

Follow-up for PR #34909.

This fixes an issue that network interfaces cannot join a master netdev,
like bond or bridge, when the corresponding .netdev is reloaded.

With PR #34909, networkd supports reloading .netdev files. However,
When a .netdev file is modified and reloaded, ifindex is copied from
the old NetDev object to the new one. Thus, even if the interface is
successfully updated, netdev_set_ifindex_impl() will return 0 and
netdev_enter_ready() will never called. If the netdev is a kind of
master netdev, then port interfaces cannot join the master netdev,
as REQUEST_TYPE_SET_LINK_MASTER requires that the master netdev is
in the ready state.

12 months agonetwork/netdev: do not update MAC address if netdev is already running
Yu Watanabe [Wed, 13 Nov 2024 02:44:46 +0000 (11:44 +0900)] 
network/netdev: do not update MAC address if netdev is already running

Follow-up for 17c5337f7b2993619d84acc2088b2ba1789e6477.

Older kernels (older than v6.5) refuse RTM_NEWLINK messages with IFLA_ADDRESS
attribute when the netdev already exists and is running, even if the MAC
address is unchanged.

So, let's not set IFLA_ADDRESS or IFLA_MTU if they are unchanged, and
set the attributes only when we can update them.

12 months agonetwork/netdev: set interface name only when creating a new netdev
Yu Watanabe [Wed, 13 Nov 2024 05:13:01 +0000 (14:13 +0900)] 
network/netdev: set interface name only when creating a new netdev

Otherwise, the kernel older than v6.2 will refuse the netlink message.

12 months agotmpfiles.d/meson: remove the need of specifying empty condition 35153/head
Mike Yuan [Wed, 13 Nov 2024 21:30:40 +0000 (22:30 +0100)] 
tmpfiles.d/meson: remove the need of specifying empty condition

12 months agotmpfiles.d/meson: call subdir_done() early if tmpfiles is disabled
Mike Yuan [Wed, 13 Nov 2024 21:23:40 +0000 (22:23 +0100)] 
tmpfiles.d/meson: call subdir_done() early if tmpfiles is disabled

12 months agomkosi: update debian commit reference 35151/head
Luca Boccassi [Wed, 13 Nov 2024 17:03:45 +0000 (17:03 +0000)] 
mkosi: update debian commit reference

48fabbd5d2 Install new sd-keyutil binary in sd-repart package
6dd9ab10fe Update changelog for 257~rc1-4 release
6dd325f04b Backport patch to fix TEST-07-PID1 integration test
5988cc60ee Update changelog for 257~rc1-3 release
cf3a2f7ccc Backport another patch to fix test failure on buildd
5d6a226dbb Update changelog for 257~rc1-2 release
ebe97c52c8 Backport patch to fix unit test failure on buildd
21f63b20bb Update changelog for 257~rc1-1 release
0dfec51bbb d/copyright: remove pattern for directory that is no longer present
337b3bb2dd Ignore Lintian warning dh-exec-script-without-dh-exec-features
b680e6b448 List new libsystemd0 symbols
3c00aa000c gbp.conf: use --first-parent for dch to avoid upstream commits
d53ecc7769 Install new files
546e8c9137 Drop all patches, merged upstream
6757597480 Update upstream source from tag 'upstream/257_rc1'
4b82805020 gbp.conf: switch upstream branch to full upstream history
e60c637a95 gbp.conf: enable signing tags by default
2ad27b63c4 Update changelog for 256.7-3 release
a212c36c54 systemd-boot: provide integration with shim

12 months agofetch-distro: use git log --first-parent
Luca Boccassi [Wed, 13 Nov 2024 17:03:35 +0000 (17:03 +0000)] 
fetch-distro: use git log --first-parent

We now import the upstream tag in the debian repository, so
this explodes as it tries to walk all upstream commits. Use
--first-parent so that merges only get added via the merge
commit.

12 months agologind-session: be more specific about session_kill() errors 35150/head
Mike Yuan [Wed, 13 Nov 2024 16:41:14 +0000 (17:41 +0100)] 
logind-session: be more specific about session_kill() errors

When kill_whom == _ALL, there can be two cases that lead to
ESRCH: the session expects no scope at all or the scope is
not active. Let's distinguish the two cases.

12 months agoportable: do not use SYNTHETIC_ERRNO for sd_bus_error_set_errno()
Mike Yuan [Wed, 13 Nov 2024 16:45:53 +0000 (17:45 +0100)] 
portable: do not use SYNTHETIC_ERRNO for sd_bus_error_set_errno()

The concept of synthetic errnos is about logging, which
is irrelevant irt bus error and we don't do any special
treatment in sd-bus for them, meaning the value propagated
would be spurious.

12 months agosd-bus/bus-common-errors: reorder one pid1 error to group with others
Mike Yuan [Wed, 13 Nov 2024 16:26:07 +0000 (17:26 +0100)] 
sd-bus/bus-common-errors: reorder one pid1 error to group with others

12 months agonamespace-util: pin pid via pidfd during namespace_open()
Lennart Poettering [Fri, 8 Nov 2024 22:06:44 +0000 (23:06 +0100)] 
namespace-util: pin pid via pidfd during namespace_open()

12 months agonetwork/ndisc: fix removal of unnecessary routes (#35128)
Luca Boccassi [Wed, 13 Nov 2024 14:06:21 +0000 (14:06 +0000)] 
network/ndisc: fix removal of unnecessary routes (#35128)

Follow-up for 972f1d17ab461a51142a142609dd3ec50bae8440.

This fixes the logic of removing unnecessary routes configured by the
previously received RAs. Previously, we wrongly handled existing routes
could be updated, and unexpected routes would be kept.

12 months agosd-boot/sd-stub: two log message fixes (#35143)
Yu Watanabe [Wed, 13 Nov 2024 01:09:05 +0000 (10:09 +0900)] 
sd-boot/sd-stub: two log message fixes (#35143)

Fixes: #35033
Fixes: #35100
12 months agoaudit-util: return -ENODATA from audit_{session|loginuid}_from_pid() if invoked in...
Yu Watanabe [Wed, 13 Nov 2024 01:08:29 +0000 (10:08 +0900)] 
audit-util: return -ENODATA from audit_{session|loginuid}_from_pid() if invoked in a container (#35072)

The auditing subsystem is still not virtualized for containers, hence
the two values don't really make sense inside them, they will just leak
information from outside into the container. Hence don't make use of the
data if we detect we are run inside of a container.

This has visible effects: logind will no longer try to reuse the
auditing session ids as its own session ids when run inside a container.

While are at it, modernize the calls in more ways:

1. switch to pidref behaviour, all but one of our uses are using pidref
anyway already.
2. use read_virtual_file() + proc_mounted()
3. reasonably distinguish ENOENT errors when reading the process proc
files: distinguish the case where /proc is not mounted, from the case
where the process is already gone, from where auditing is not enabled in
the kernel build.

12 months agoptyfwd: ellipsize overly long window titles
Lennart Poettering [Tue, 12 Nov 2024 21:18:05 +0000 (22:18 +0100)] 
ptyfwd: ellipsize overly long window titles

Apparently some terminal emulators have problems with overly long
titles, hence truncate them at some safe length (128).

Also, when parsing ANSI sequences ourselves accept longer sequences
(192), after all we should be fine when parsing our own title sequences.

Fixes: #35104
12 months agovarious: check meson feature flag early
Mike Yuan [Tue, 12 Nov 2024 18:30:38 +0000 (19:30 +0100)] 
various: check meson feature flag early

Prompted by https://github.com/systemd/systemd/pull/35110#discussion_r1835885340

12 months agope: use PE_SECTION_VECTOR_IS_SET() macro where appropriate 35143/head
Lennart Poettering [Tue, 12 Nov 2024 22:17:41 +0000 (23:17 +0100)] 
pe: use PE_SECTION_VECTOR_IS_SET() macro where appropriate

12 months agope: remove unnecessary log message about DT/HWID
Lennart Poettering [Tue, 12 Nov 2024 22:15:17 +0000 (23:15 +0100)] 
pe: remove unnecessary log message about DT/HWID

Fixes: #35100
12 months agoefi: don't log if EFI RNG isn't ready
Lennart Poettering [Tue, 12 Nov 2024 22:22:39 +0000 (23:22 +0100)] 
efi: don't log if EFI RNG isn't ready

Apparently this happens IRL on some systems, let's handle this
gracefully and don't log.

Fixes: #35033
12 months agorun0: when changing privileges to non-root, do not show superhero emoji
Lennart Poettering [Tue, 12 Nov 2024 13:18:31 +0000 (14:18 +0100)] 
run0: when changing privileges to non-root, do not show superhero emoji

Let's show an idcard logo instead, to indicate that we changed ids.

12 months agodbus-manager: add missing word 'unit' to PK message
Lennart Poettering [Tue, 12 Nov 2024 14:22:31 +0000 (15:22 +0100)] 
dbus-manager: add missing word 'unit' to PK message

12 months agotree-wide: remove some dead code (#35137)
Lennart Poettering [Tue, 12 Nov 2024 22:08:45 +0000 (23:08 +0100)] 
tree-wide: remove some dead code (#35137)

12 months agoprocess-util: more gracefully handle oom adjust parsing/setting 35072/head
Lennart Poettering [Thu, 7 Nov 2024 13:54:21 +0000 (14:54 +0100)] 
process-util: more gracefully handle oom adjust parsing/setting

Who knows what kind of mount shenanigans people employ, let's gracefully
handle parse failures of proc files, like we alway do otherwsie.

12 months agoaudit-util: modernize use_audit() a bit
Lennart Poettering [Thu, 7 Nov 2024 16:49:34 +0000 (17:49 +0100)] 
audit-util: modernize use_audit() a bit

Use ERRNO_IS_xyz() macros where appropriate.

Also, reduce indentation a bit by inverted early check.

And log in more error codepaths.

12 months agoaudit-util: return -ENODATA from audit_{session|loginuid}_from_pid() if invoked in...
Lennart Poettering [Thu, 7 Nov 2024 13:48:57 +0000 (14:48 +0100)] 
audit-util: return -ENODATA from audit_{session|loginuid}_from_pid() if invoked in a container

The auditing subsystem is still not virtualized for containers, hence the two
values don't really make sense inside them, they will just leak
information from outside into the container. Hence don't make use of the
data if we detect we are run inside of a container.

This has visible effects: logind will no longer try to reuse the
auditing session ids as its own session ids when run inside a container.

While are at it, modernize the calls in more ways:

1. switch to pidref behaviour, all but one of our uses are using pidref
   anyway already.
2. use read_virtual_file() + proc_mounted()
3. reasonable distinguish ENOENT errors when reading the process proc
   files: distinguish the case where /proc is not mounted, from the case
   where the process is already gone, from where auditing is not enabled
   in the kernel build.

12 months agomkosi: ruff is not available on all distros
Davide Cavalca [Tue, 12 Nov 2024 04:49:36 +0000 (20:49 -0800)] 
mkosi: ruff is not available on all distros

Refactor to only install ruff where it is available

12 months agoTODO: Fix typo (#35138)
Maanya Goenka [Tue, 12 Nov 2024 18:00:23 +0000 (10:00 -0800)] 
TODO: Fix typo (#35138)

Replace confex with confext

12 months agonspawn: fix indentation of run_container() parameter list 35137/head
Lennart Poettering [Mon, 11 Nov 2024 16:49:32 +0000 (17:49 +0100)] 
nspawn: fix indentation of run_container() parameter list

12 months agomntwork: shorten code
Lennart Poettering [Fri, 8 Nov 2024 22:07:00 +0000 (23:07 +0100)] 
mntwork: shorten code

12 months agodissect-image: remove dead code
Lennart Poettering [Mon, 11 Nov 2024 16:19:26 +0000 (17:19 +0100)] 
dissect-image: remove dead code

12 months agomountfsd: drop unused variable
Lennart Poettering [Fri, 8 Nov 2024 11:14:52 +0000 (12:14 +0100)] 
mountfsd: drop unused variable

12 months agosbsign: remove unused --no-pager option
Antonio Alvarez Feijoo [Tue, 12 Nov 2024 15:18:30 +0000 (16:18 +0100)] 
sbsign: remove unused --no-pager option

12 months agomkosi: Install tpm2-tss-devel to tools for CentOS and Fedora instead of tss2-devel
Davide Cavalca [Tue, 12 Nov 2024 04:44:50 +0000 (20:44 -0800)] 
mkosi: Install tpm2-tss-devel to tools for CentOS and Fedora instead of tss2-devel

tss2-devel is the IBM TPM stack, we want the Intel TPM stack, so let's
use the correct package.

12 months agoFix man page links broken due to incorrect volume numbers (#35122)
Yu Watanabe [Tue, 12 Nov 2024 09:23:47 +0000 (18:23 +0900)] 
Fix man page links broken due to incorrect volume numbers (#35122)

12 months agotest-network: several cleanups 35128/head
Yu Watanabe [Tue, 12 Nov 2024 07:04:16 +0000 (16:04 +0900)] 
test-network: several cleanups

- fix verifiers in test_router_preference() to make them actually check
  if unnecessary routes are removed,
- stop radv in test_ndisc_vs_static_route() before checking if the static
  route is preserved even when the router sends a RA with zero lifetime,
- make verifiers in NetworkdIPv6PrefixTests stricter.

12 months agonetwork/ndisc: restore the original preference and priority before checking if existi...
Yu Watanabe [Mon, 11 Nov 2024 17:11:12 +0000 (02:11 +0900)] 
network/ndisc: restore the original preference and priority before checking if existing route can be updated

Follow-up for 972f1d17ab461a51142a142609dd3ec50bae8440.

This fixes the logic of removing unnecessary routes configured by the
previously received RAs. Previously, we wrongly handled existing routes
could be updated, and unexpected routes would be kept.

12 months agonetwork/ndisc: introduce ndisc_route_prepare() and ndisc_router_route_prepare()
Yu Watanabe [Mon, 11 Nov 2024 19:31:55 +0000 (04:31 +0900)] 
network/ndisc: introduce ndisc_route_prepare() and ndisc_router_route_prepare()

These applies common parameters to the route to be requested or removed.
No functional change, just refactoring and preparation for later
commits.

12 months agonetwork/ndisc: several cleanups for ndisc_remove_route()
Yu Watanabe [Mon, 11 Nov 2024 17:06:21 +0000 (02:06 +0900)] 
network/ndisc: several cleanups for ndisc_remove_route()

- drop unnecessary call of ndisc_set_route_priority() at the beginning,
  as it is called later in the loop below,
- use RET_GATHER() and remove all possible routes even if failed.

12 months agonetwork/ndisc: introduce route_is_bound_to_link() helper function and use it where...
Yu Watanabe [Mon, 11 Nov 2024 17:03:44 +0000 (02:03 +0900)] 
network/ndisc: introduce route_is_bound_to_link() helper function and use it where applicable

No functional change, and preparation for later commits.

12 months agoman/systemd-keyutil: fix rendering typo
Antonio Alvarez Feijoo [Tue, 12 Nov 2024 07:29:28 +0000 (08:29 +0100)] 
man/systemd-keyutil: fix rendering typo

12 months agoman/systemd.special: fix a typo 35122/head
Štěpán Němec [Mon, 11 Nov 2024 19:31:43 +0000 (20:31 +0100)] 
man/systemd.special: fix a typo

12 months agoman: fix incorrect volume numbers in internal man page references
Štěpán Němec [Mon, 11 Nov 2024 19:10:00 +0000 (20:10 +0100)] 
man: fix incorrect volume numbers in internal man page references

Some ambiguity (e.g., same-named man pages in multiple volumes)
makes it impossible to fully automate this, but the following
Python snippet (run inside the man/ directory of the systemd repo)
helped to generate the sed command lines (which were subsequently
manually reviewed, run and the false positives reverted):

from pathlib import Path

import lxml
from lxml import etree as ET

man2vol: dict[str, str] = {}
man2citerefs: dict[str, list] = {}

for file in Path(".").glob("*.xml"):
    tree = ET.parse(file, lxml.etree.XMLParser(recover=True))
    meta = tree.find("refmeta")
    if meta is not None:
        title = meta.findtext("refentrytitle")
        if title is not None:
            vol = meta.findtext("manvolnum")
            if vol is not None:
                man2vol[title] = vol
            citerefs = list(tree.iter("citerefentry"))
            if citerefs:
                man2citerefs[title] = citerefs

for man, refs in man2citerefs.items():
    for ref in refs:
        title = ref.findtext("refentrytitle")
        if title is not None:
            has = ref.findtext("manvolnum")
            try:
                should_have = man2vol[title]
            except KeyError:  # Non-systemd man page reference?  Ignore.
                continue
            if has != should_have:
                print(
                    f"sed -i '\\|<citerefentry><refentrytitle>{title}"
                    f"</refentrytitle><manvolnum>{has}</manvolnum>"
                    f"</citerefentry>|s|<manvolnum>{has}</manvolnum>|"
                    f"<manvolnum>{should_have}</manvolnum>|' {man}.xml"
                )

12 months agonetwork: forget IPv4 non-local routes when an interface went down (#35099)
Yu Watanabe [Mon, 11 Nov 2024 16:07:43 +0000 (01:07 +0900)] 
network: forget IPv4 non-local routes when an interface went down (#35099)

Fixes #35047.

12 months agoIntroduce systemd-keyutil to do various key/certificate operations (#35095)
Lennart Poettering [Mon, 11 Nov 2024 15:09:07 +0000 (16:09 +0100)] 
Introduce systemd-keyutil to do various key/certificate operations (#35095)

Let's gather generic key/certificate operations in a new tool
systemd-keyutil instead of spreading them across various special purpose
tools.

Fixes #35087

12 months agotest-network: add test case for issue #35047 35099/head
Yu Watanabe [Fri, 8 Nov 2024 13:55:20 +0000 (22:55 +0900)] 
test-network: add test case for issue #35047

12 months agonetwork/nexthop: also forget IPv4 nexthops when an interface went down
Yu Watanabe [Mon, 11 Nov 2024 04:00:10 +0000 (13:00 +0900)] 
network/nexthop: also forget IPv4 nexthops when an interface went down

Similar to the previous commit, but for nexthop.

12 months agonetwork/route: forget IPv4 non-local routes when an interface went down
Yu Watanabe [Fri, 8 Nov 2024 13:07:53 +0000 (22:07 +0900)] 
network/route: forget IPv4 non-local routes when an interface went down

When an interface went down, IPv4 non-local routes are removed by the
kernel without any notifications. Let's forget the routes in that case.

Fixes #35047.

12 months agonetwork/nexthop: forget dependent routes without trying to remove
Yu Watanabe [Mon, 11 Nov 2024 03:26:48 +0000 (12:26 +0900)] 
network/nexthop: forget dependent routes without trying to remove

When a nexthop is removed, routes depend on the removed nexthop are
already removed. It is not necessary to remove them, as already
commented. Let's forget them without trying to remove.

12 months agonetwork/nexthop: do not remove depending nexthops when a nexthop is removed
Yu Watanabe [Mon, 11 Nov 2024 04:51:49 +0000 (13:51 +0900)] 
network/nexthop: do not remove depending nexthops when a nexthop is removed

Previously, when a nexthop is removed, depending nexthops were removed, but
that's not necessary, as the kernel keeps them, at least with v6.11.

12 months agonetwork/route: update reference of the route from nexthop
Yu Watanabe [Mon, 11 Nov 2024 07:05:54 +0000 (16:05 +0900)] 
network/route: update reference of the route from nexthop

Follow-up for 6f09031e4d04727cc72164fefcbc763e37556493.

The function has been introduced by the commit, but it has never been used...

12 months agonetwork: further rework for reconfiguring interfaces (#35059)
Luca Boccassi [Mon, 11 Nov 2024 12:59:31 +0000 (12:59 +0000)] 
network: further rework for reconfiguring interfaces (#35059)

Follow-ups for #35035.
Split-out of #34989.
Fixes #35092.

12 months agoSplit src/partition (#35110)
Yu Watanabe [Mon, 11 Nov 2024 09:36:26 +0000 (18:36 +0900)] 
Split src/partition (#35110)

12 months agopo: Translated using Weblate (Portuguese (Brazil))
Gabriel Elyas [Mon, 11 Nov 2024 08:36:51 +0000 (09:36 +0100)] 
po: Translated using Weblate (Portuguese (Brazil))

Currently translated at 96.1% (247 of 257 strings)

Co-authored-by: Gabriel Elyas <gabrielelyas@protonmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/pt_BR/
Translation: systemd/main

12 months agoRename src/partition to src/repart 35110/head
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2024 13:05:08 +0000 (14:05 +0100)] 
Rename src/partition to src/repart

12 months agonetwork: make 'networkctl reconfigure' work safely even when KeepConfiguration=dhcp... 35059/head
Yu Watanabe [Wed, 6 Nov 2024 18:26:39 +0000 (03:26 +0900)] 
network: make 'networkctl reconfigure' work safely even when KeepConfiguration=dhcp or yes

Previously, even if KeepConfiguration=dhcp or yes is specified in the
new .network file, dynamic configurations like DHCP address and routes
were dropped when 'networkctl reconfigure INTERFACE' is invoked.

If the setting is specified, let's gracefully handle the dynamic
configurations. Then, 'networkctl reconfigure' can be also used for
an interface that has critical connections.

12 months agonetwork: drop static configs later
Yu Watanabe [Wed, 6 Nov 2024 18:02:54 +0000 (03:02 +0900)] 
network: drop static configs later

Follow-up for dd6d53a8dc58c5e6e310b09ba7f7a22600a87ba9.

Unnecessary static configs will be anyway dropped later in
link_configure() -> link_drop_unmanaged_config(). Hence, even if we are
reconfiguring an interface cleanly, it is not necessary to drop static
configs here.

12 months agonetwork/dhcp-pd: do not remove unreachable route when reconfiguring non-upstream...
Yu Watanabe [Thu, 7 Nov 2024 00:16:06 +0000 (09:16 +0900)] 
network/dhcp-pd: do not remove unreachable route when reconfiguring non-upstream interface

Unreachable routes are not owned by any interfaces, and its ifindex is
zero. Previously, if a non-upstream interface is reconfigured, all routes
including unreachable routes configured by the upstream interface are
removed.

This makes unreachable routes are always handled by the upstream interface,
and only removed when the delegated prefixes are changed or lost.

12 months agonetwork: reorder dropping dynamic configuration
Yu Watanabe [Thu, 7 Nov 2024 01:13:37 +0000 (10:13 +0900)] 
network: reorder dropping dynamic configuration

Follow-up for 451c2baf30f50b95d73e648058c7c2348dbf0c31.

12 months agotest-network: reconfigure interface cleanly to drop previous DHCP lease and friends
Yu Watanabe [Thu, 7 Nov 2024 00:52:03 +0000 (09:52 +0900)] 
test-network: reconfigure interface cleanly to drop previous DHCP lease and friends

Follow-up for 451c2baf30f50b95d73e648058c7c2348dbf0c31.

With the commits, reloading .network files does not release previously
acquired DHCP lease and friends if possible.

On graceful reconfigure triggered by the reload, the interface may
acquire a new DHCPv4 lease earlier than DHCPv6 lease. In that case,
the check will fail as it is done with the new DHCPv4 lease and old
DHCPv6 lease, which does not contain any IPv6 DNS servers or so.
So, when switching from no -> yes, we need to wait a new lease with DNS
servers or so. To achieve that, we need to clean reconfigure the interface.

12 months agonetwork: reset 'configured' flags even if we keep DHCP lease and friends on reconfigure
Yu Watanabe [Thu, 7 Nov 2024 00:52:03 +0000 (09:52 +0900)] 
network: reset 'configured' flags even if we keep DHCP lease and friends on reconfigure

Follow-up for 451c2baf30f50b95d73e648058c7c2348dbf0c31.

With the commits, reloading .network files does not release previously
acquired DHCP lease and friends if possible. If previously a DHCP client
was configured as not requesting DNS servers or so, then the previously
acquired lease might not contain any DNS servers. In that case, if the
new .network file enables UseDNS=, then the interface should enter the
configured state after a new lease is acquired. To achieve that, we need
to reset the flags.

With this change, the workaround applied to the test by the commit
451c2baf30f50b95d73e648058c7c2348dbf0c31 can be dropped.

12 months agonetwork: drop unnecessary size specifier
Yu Watanabe [Thu, 7 Nov 2024 03:00:38 +0000 (12:00 +0900)] 
network: drop unnecessary size specifier

It does not save any memory usage but increase code complexity.

12 months agonetwrok: call link_drop_unmanaged_config() earlier in link_configure()
Yu Watanabe [Fri, 8 Nov 2024 11:38:42 +0000 (20:38 +0900)] 
netwrok: call link_drop_unmanaged_config() earlier in link_configure()

Otherwise, even if a link enters the configuring state at the beginning
of link_configure(), link_check_ready() may be called before
link_drop_unmanaged_config() is called, and the link may enter the
configured state.

Fixes #35092.

12 months agoMove growfs+makefs to src/growfs/
Zbigniew Jędrzejewski-Szmek [Sun, 10 Nov 2024 13:01:34 +0000 (14:01 +0100)] 
Move growfs+makefs to src/growfs/

Those two programs are used together and it makes sense to keep them
together. makefs is smaller, so name the directory after growfs.

12 months agoVarious multi-dt fixes and CHID test (#35056)
Yu Watanabe [Sun, 10 Nov 2024 02:19:10 +0000 (11:19 +0900)] 
Various multi-dt fixes and CHID test (#35056)

Part of #34158

12 months agologin: fix session_kill(..., KILL_LEADER,...) (#35105)
12paper [Sun, 10 Nov 2024 02:13:39 +0000 (03:13 +0100)] 
login: fix session_kill(..., KILL_LEADER,...) (#35105)

`loginctl kill-session --kill-whom=leader <N>` (or the D-Bus equivalent)
doesn't work because logind ends up calling `KillUnit(..., "main", ...)`
on a scope unit and these don't have a `MainPID` property. Here, I just
make it send a signal to the `Leader` directly.

12 months agoukify: Fix broken assert when building a signed addon
Valentin David [Sat, 9 Nov 2024 12:56:34 +0000 (13:56 +0100)] 
ukify: Fix broken assert when building a signed addon

An assert always expected a kernel when signature key was present in command
line. That prevented building signed addons.

Fixes #35041

12 months agopo: Translated using Weblate (German)
Weblate Translation Memory [Sat, 9 Nov 2024 20:14:00 +0000 (21:14 +0100)] 
po: Translated using Weblate (German)

Currently translated at 93.7% (241 of 257 strings)

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

12 months agopo: Translated using Weblate (German)
Ettore Atalan [Sat, 9 Nov 2024 20:14:00 +0000 (21:14 +0100)] 
po: Translated using Weblate (German)

Currently translated at 93.7% (241 of 257 strings)

Co-authored-by: Ettore Atalan <atalanttore@googlemail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/de/
Translation: systemd/main

12 months agomeson.build: add a few features to summary
Mike Yuan [Fri, 8 Nov 2024 18:28:24 +0000 (19:28 +0100)] 
meson.build: add a few features to summary

12 months agosysupdate: Bug fixes for target enumeration (#35052)
Luca Boccassi [Fri, 8 Nov 2024 23:21:29 +0000 (23:21 +0000)] 
sysupdate: Bug fixes for target enumeration (#35052)

Fixes a couple of bugs with systemd-sysupdated's target enumeration. See
commit messages for details.

<!-- devel-freezer =
{"comment-id":"2460494553","freezing-tag":"v257-rc1"} -->