]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 months agonetwork/route: introduce route_remove_and_cancel()
Yu Watanabe [Tue, 9 Jan 2024 06:49:20 +0000 (15:49 +0900)] 
network/route: introduce route_remove_and_cancel()

Then, replace route_remove_and_drop() with it.

If a route is requested, and the request is already called,
we may not received its reply and notification from the kernel, and
the corresponding Route object may not be remembered. Even in such
case, we need to remove the route, otherwise the route will come
later after the function called.

This is the version for route of f22b586a215962416bdbd692aabb89b1ac2999d0.

4 months agoMerge pull request #31072 from YHNdnzj/va-arg-foreach
Mike Yuan [Thu, 25 Jan 2024 07:22:07 +0000 (15:22 +0800)] 
Merge pull request #31072 from YHNdnzj/va-arg-foreach

tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT (VA_ARGS_FOREACH)

4 months agotest: use the default nsec3-iterations value
Frantisek Sumsal [Wed, 24 Jan 2024 18:19:29 +0000 (19:19 +0100)] 
test: use the default nsec3-iterations value

In Knot 3.2 the nsec3-iterations default was changed to 0 and Knot now
issues a warning if the value is > 0. Let's just use the default value,
since it's not something that's important for our tests.

4 months agoefi: Add EFI CC measurement protocol to stub
Mikko Ylinen [Thu, 18 Jan 2024 11:34:09 +0000 (13:34 +0200)] 
efi: Add EFI CC measurement protocol to stub

In confidential computing, a virtual firmware may support measurement and
event log based upon the hardware Trusted Execution Environment (TEE)
capability.

The UEFI specification defines an interface between the virtual guest OS
and virtual firmware as EFI_CC_MEASUREMENT_PROTOCOL. The (vendor specific)
measurements are captured in the CC eventlog that follows the TCG2 format.

OVMF virtual firmware has the EFI_CC_MEASUREMENT_PROTOCOL support for
Intel Trust Domain Extensions (TDX). Intel TDX has 4 runtime measurement
registers (RTMR) defined as:

RTMR[0] for TDVF configuration
RTMR[1] for the TD OS loader and kernel
RTMR[2] for the OS application
RTMR[3] reserved for special usage only

The RTMR to PCR mappings are defined in the UEFI Spec 2.10 Section 38.4.1
as follows:

TPM PCR Index | CC Measurement Register Index | TDX-measurement register
------------------------------------------------------------------------
0             |   0                           |   MRTD
1, 7          |   1                           |   RTMR[0]
2-6           |   2                           |   RTMR[1]
8-15          |   3                           |   RTMR[2]

The CC measurement eventlog is currently exposed as a raw CCEL ACPI table
by the guest OS and the events can be replayed to check log matches with
the RTMR values.

Add EFI CC measurement protocol to stub to get the UKI components measured
and included in the remote attestation reports when vTPMs are not available.

4 months agomkosi: install libip4tc2 in debian/ubuntu
Luca Boccassi [Wed, 24 Jan 2024 19:36:53 +0000 (19:36 +0000)] 
mkosi: install libip4tc2 in debian/ubuntu

It's now a dlopen library and it is installed at build time via
libiptc-dev, but was never added to the running image.

Follow-up for 5b5f8f8b9aef405cdc42771e7876988d5aefb51e

4 months agoMake RestartPreventExitStatus= documentation resemble SuccessExitStatus=
Andrew Sayers [Tue, 9 Jan 2024 12:41:29 +0000 (12:41 +0000)] 
Make RestartPreventExitStatus= documentation resemble SuccessExitStatus=

The documentation for `RestartPreventExitStatus=` differs from that for `SuccessExitStatus=` in ways that are sometimes confusing (e.g. using `numeric exit codes` instead of `numeric termination statuses`), and other times plain incorrect (e.g. not mentioning `termination status names`, which I've just confirmed to work in systemd 255).

This patch modifies the documentation to be as similar as possible, so as to reduce the reader's cognitive load.

4 months agoRemove a few references to dracut
Daan De Meyer [Fri, 19 Jan 2024 13:21:24 +0000 (14:21 +0100)] 
Remove a few references to dracut

Let's remove some explicit references to dracut as we prefer initrds
built with mkosi these days.

4 months agotree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT 31072/head
Mike Yuan [Wed, 24 Jan 2024 08:51:58 +0000 (16:51 +0800)] 
tree-wide: replace FOREACH_POINTER with FOREACH_ARGUMENT

The latter is more generic and while being compatible with
the former.

4 months agomacro: rename VA_ARGS_FOREACH to FOREACH_ARGUMENT
Mike Yuan [Wed, 24 Jan 2024 13:15:53 +0000 (21:15 +0800)] 
macro: rename VA_ARGS_FOREACH to FOREACH_ARGUMENT

"VA_ARGS" is kinda confusing, as the macro just iterates through
all arguments passed and has nothing to do with va_arg.

4 months agonetwork/route: manage all routes by Manager object
Yu Watanabe [Sun, 14 Jan 2024 05:20:03 +0000 (14:20 +0900)] 
network/route: manage all routes by Manager object

Previously, a Route object is owned by a Link object corresponding to the
outgoing interface of the route, and a Route object that does not have
outgoing interface is owned by the Manager object.

However, there were several issues:
- if a route has a nexthop ID, then the corresponding nexthop may be
  changed to use another interface, hence the outgoing interface of the
  route may be changed.
- if a route requested with MultiPathRoute=, then the link who requests
  the route is different from the outgoing interface of the configured
  route. So, we need to find routes on other interfaces on reconfiguring
  or so.

By this change, the limit of the number of routes per-interface is
tentatively dropped. Let's re-introduce the limit later in a nicer way.

4 months agohwdb: ieee1394-unit-function: adjustment of entries with device attributes available...
Takashi Sakamoto [Tue, 23 Jan 2024 06:20:29 +0000 (15:20 +0900)] 
hwdb: ieee1394-unit-function: adjustment of entries with device attributes available in Linux v6.8

The series of changes[1] has been merged to Linux v6.8-rc1[2], which
alters the parser of the content of configuration ROM. As a result, some
device attributes for model information in the legacy layout of
configuration ROM are finally available for node and unit devices. The
change enables to distinguish the devices by model information, and what
is required in systemd PR 30205[3]. It can improve the hwdb for IEEE 1394
functions in the point addressed at issue 25029[4].

This commit fulfills some entries for the hwdb, which corresponds to some
devices with the legacy layout of configuration ROM. They provides both
vendor and model names to udev applications.

[1] https://lore.kernel.org/lkml/20240110111331.GA138108@workstation.local/
[2] https://lore.kernel.org/lkml/CAHk-=wiB4iHTtfZKiy5pC24uOjun4fbj4kSX0=ZnGsOXadMf6g@mail.gmail.com/
[3] https://github.com/systemd/systemd/pull/30205
[4] https://github.com/systemd/systemd/issues/25029

4 months agoid128-util: use FOREACH_STRING where appropriate
Mike Yuan [Wed, 24 Jan 2024 09:02:28 +0000 (17:02 +0800)] 
id128-util: use FOREACH_STRING where appropriate

4 months agoMerge pull request #31003 from enr0n/skip-test-when-apparmor-restricts-userns
Lennart Poettering [Wed, 24 Jan 2024 08:58:07 +0000 (09:58 +0100)] 
Merge pull request #31003 from enr0n/skip-test-when-apparmor-restricts-userns

Skip more tests when apparmor restricts unprivileged user namespaces

4 months agoMerge pull request #31067 from RA-Kooi/xen-uuid
Lennart Poettering [Wed, 24 Jan 2024 08:35:30 +0000 (09:35 +0100)] 
Merge pull request #31067 from RA-Kooi/xen-uuid

machine-id-setup: Generate stable machine IDs on Xen virtual machines.

4 months agoMerge pull request #31070 from yuwata/core-cleanups
Yu Watanabe [Wed, 24 Jan 2024 07:31:37 +0000 (16:31 +0900)] 
Merge pull request #31070 from yuwata/core-cleanups

core: several trivial cleanups

4 months agocore/exec-invoke: drop unused pam_pid 31070/head
Yu Watanabe [Wed, 24 Jan 2024 05:40:25 +0000 (14:40 +0900)] 
core/exec-invoke: drop unused pam_pid

4 months agocore/service: declare 'int r' at the beginning
Yu Watanabe [Wed, 24 Jan 2024 05:39:20 +0000 (14:39 +0900)] 
core/service: declare 'int r' at the beginning

4 months agounit: modernize unit_pid_set()
Yu Watanabe [Wed, 24 Jan 2024 05:33:41 +0000 (14:33 +0900)] 
unit: modernize unit_pid_set()

4 months agocore: use helper functions like unit_main_pid() in unit_kill_context()
Yu Watanabe [Wed, 24 Jan 2024 05:02:46 +0000 (14:02 +0900)] 
core: use helper functions like unit_main_pid() in unit_kill_context()

No functional changes. Just refactoring.

4 months agocore: introduce unit_main_pid_full() which optionally provides if the PID is alien...
Yu Watanabe [Wed, 24 Jan 2024 05:08:40 +0000 (14:08 +0900)] 
core: introduce unit_main_pid_full() which optionally provides if the PID is alien or not

4 months agocore: constify PidRef arguments
Yu Watanabe [Wed, 24 Jan 2024 04:54:45 +0000 (13:54 +0900)] 
core: constify PidRef arguments

4 months agoman: Describe how machine ID is initialized on Xen 31067/head
Rafaël Kooi [Wed, 24 Jan 2024 01:19:00 +0000 (02:19 +0100)] 
man: Describe how machine ID is initialized on Xen

4 months agonspawn: fix separating empty lines in --help text
Lennart Poettering [Tue, 23 Jan 2024 22:03:42 +0000 (23:03 +0100)] 
nspawn: fix separating empty lines in --help text

When I added the --background= switch I placed the empty line that was
supposed to separate the options from the next section before the switch
rather than after. Fix that.

To make issues like this harder to run into next time, let's move the \n
from the end of the preceeding line to the beginning of the section
title, since that's pretty much where they belong to.

Follow-up for: 3d8ba7b83f254ec9e137210630a602001674e4d0

4 months agohostname-setup: read hostname from system.hostname credential
Ivan Shapovalov [Sun, 7 Jan 2024 02:01:28 +0000 (03:01 +0100)] 
hostname-setup: read hostname from system.hostname credential

`system.hostname` credential is treated similarly to the pre-existing
`system.machine_id` credential. It is considered after /etc/hostname,
but prior to the kernel defaults or os-release defaults.

Fixes #30667.

Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
4 months agoMerge pull request #30130 from poettering/pcrlock-root
Luca Boccassi [Tue, 23 Jan 2024 21:41:02 +0000 (21:41 +0000)] 
Merge pull request #30130 from poettering/pcrlock-root

pcrlock: add support for unlocking a root fs with a pcrlock file

4 months agoMerge pull request #31026 from poettering/nspawn-tint
Lennart Poettering [Tue, 23 Jan 2024 21:32:00 +0000 (22:32 +0100)] 
Merge pull request #31026 from poettering/nspawn-tint

nspawn: allow tinting the background of interactive tty sessions

4 months agorepart: don't try to determine sector size from a disk image we should consider empty
Lennart Poettering [Tue, 23 Jan 2024 15:05:37 +0000 (16:05 +0100)] 
repart: don't try to determine sector size from a disk image we should consider empty

If we are told to start from scratch we shouldn't look into the old
image to determine sector size. Looking there is confusing at best, but
plain wrong in many other cases.

4 months agopreset: add some alphabetical sorting
Lennart Poettering [Tue, 23 Jan 2024 15:52:56 +0000 (16:52 +0100)] 
preset: add some alphabetical sorting

I think the existing sections in the preset file make sense, but
alphabetical ordering is kinda cool too.

try to find a middle ground, and at least sort within each section.

No actual change of behaviour, just some reordering of lines.

4 months agotest-execute: skip tests that are broken without unprivileged userns 31003/head
Nick Rosbrook [Thu, 18 Jan 2024 20:49:42 +0000 (15:49 -0500)] 
test-execute: skip tests that are broken without unprivileged userns

With newer versions of AppArmor, unprivileged user namespace creation
may be restricted by default, in which case user manager instances will
not be able to apply PrivateUsers=yes (or the settings which require it).
Additionally, if a kernel has the kernel.unprivileged_userns_clone
sysctl patch, and that sysctl is 0, then unprivileged userns creation
will always fail.

If a test unit is going to be run in a user manager, and that unit
requires PrivateUsers=yes (explicitly or implicitly), then skip it if
we do not have user namespace privileges.

4 months agomachine-id-setup: Generate stable machine IDs based on Xen hypervisor UUID
Rafaël Kooi [Mon, 22 Jan 2024 16:13:21 +0000 (17:13 +0100)] 
machine-id-setup: Generate stable machine IDs based on Xen hypervisor UUID

4 months agoid128-util: Attempt to read UUID from /sys/hypervisor/uuid
Rafaël Kooi [Mon, 22 Jan 2024 16:04:07 +0000 (17:04 +0100)] 
id128-util: Attempt to read UUID from /sys/hypervisor/uuid

When using the Xen hypervisor the virtual machine UUID is exposed here.
This is useful when one needs stable IPv4 address assignment, e.g. for a
set of RAM nodes that are built from a template.

4 months agodissect: show image name separately from filename
Lennart Poettering [Tue, 23 Jan 2024 10:48:55 +0000 (11:48 +0100)] 
dissect: show image name separately from filename

If the image name is different from the filename then show it in the
output, since it's relevant for finding sysext/confext release files.

(Image name is typically the filename without the ".raw" suffix and
similar).

4 months agounit: systemd-creds.socket is statically enabled, hence drop [Install]
Lennart Poettering [Tue, 23 Jan 2024 15:18:30 +0000 (16:18 +0100)] 
unit: systemd-creds.socket is statically enabled, hence drop [Install]

This is statically enabled, hence needs to [Install] section.

4 months agopackit: use the closest matching tag for the checked out revision
Frantisek Sumsal [Tue, 23 Jan 2024 14:29:08 +0000 (15:29 +0100)] 
packit: use the closest matching tag for the checked out revision

Packit otherwise tries to get the latest tag by creation date, which
doesn't work well in the systemd-stable repo:

2024-01-23 13:40:47.858 upstream.py       DEBUG  No ref given or is not glob pattern
2024-01-23 13:40:47.859 upstream.py       DEBUG  We're about to get latest matching tag in the upstream repository /tmp/tmp07g2beo8.
2024-01-23 13:40:47.859 commands.py       DEBUG  Command: git tag --list --sort=-creatordate
2024-01-23 13:40:47.866 logging.py        DEBUG  v248.13
2024-01-23 13:40:47.866 logging.py        DEBUG  v249.17
2024-01-23 13:40:47.866 logging.py        DEBUG  v250.14
2024-01-23 13:40:47.866 logging.py        DEBUG  v251.20
2024-01-23 13:40:47.867 logging.py        DEBUG  v252.21
2024-01-23 13:40:47.867 logging.py        DEBUG  v253.15
2024-01-23 13:40:47.867 logging.py        DEBUG  v254.8
2024-01-23 13:40:47.867 logging.py        DEBUG  v255.2
2024-01-23 13:40:47.868 logging.py        DEBUG  v255.1
2024-01-23 13:40:47.868 logging.py        DEBUG  v255
...

4 months agonspawn: tint the terminal bg blue if we are in a container 31026/head
Lennart Poettering [Fri, 19 Jan 2024 23:00:20 +0000 (00:00 +0100)] 
nspawn: tint the terminal bg blue if we are in a container

Let's give people a hint that they are not operating on the host.

4 months agopretty-print: split out color tinting into a helper of its own
Lennart Poettering [Fri, 19 Jan 2024 22:59:54 +0000 (23:59 +0100)] 
pretty-print: split out color tinting into a helper of its own

4 months agocolor-util: make return values of rgb_to_hsv() optional
Lennart Poettering [Fri, 19 Jan 2024 22:59:00 +0000 (23:59 +0100)] 
color-util: make return values of rgb_to_hsv() optional

When we want to tint the bg color we don't care about the hue, we want
to set it ourself after all, hence make the arguments optional, so that
we don't even have to ask for it.

4 months agonspawn: optionally tint the background color of a container
Lennart Poettering [Fri, 19 Jan 2024 22:41:01 +0000 (23:41 +0100)] 
nspawn: optionally tint the background color of a container

4 months agoMerge pull request #31061 from yuwata/pidref_copy
Lennart Poettering [Tue, 23 Jan 2024 15:28:01 +0000 (16:28 +0100)] 
Merge pull request #31061 from yuwata/pidref_copy

pidref: add basic tests for PidRef, and split out pidref_copy() from pidref_dup()

4 months agoman: suffix signals with ()
Frantisek Sumsal [Tue, 23 Jan 2024 12:06:55 +0000 (13:06 +0100)] 
man: suffix signals with ()

Since signals can take arguments, let's suffix them with () as we
already do with functions. To make sure we remain consistent, make the
`update-dbus-docs.py` script check & fix any occurrences where this is
not the case.

Resolves: #31002

4 months agoMerge pull request #31057 from aafeijoo-suse/bootctl-print-fix
Lennart Poettering [Tue, 23 Jan 2024 13:26:25 +0000 (14:26 +0100)] 
Merge pull request #31057 from aafeijoo-suse/bootctl-print-fix

bootctl: return earlier with `--print-esp-path`

4 months agopidref: split out pidref_copy() from pidref_dup() 31061/head
Yu Watanabe [Tue, 23 Jan 2024 13:07:47 +0000 (22:07 +0900)] 
pidref: split out pidref_copy() from pidref_dup()

4 months agovarlink: make sure varlink_server_detach_event() doesn't leave invalid pointer around
Lennart Poettering [Tue, 23 Jan 2024 11:07:23 +0000 (12:07 +0100)] 
varlink: make sure varlink_server_detach_event() doesn't leave invalid pointer around

4 months agotest: add basic tests for PidRef
Yu Watanabe [Tue, 23 Jan 2024 10:23:37 +0000 (19:23 +0900)] 
test: add basic tests for PidRef

4 months agoMerge pull request #31019 from poettering/hostnamed-full-os-release
Lennart Poettering [Tue, 23 Jan 2024 11:28:41 +0000 (12:28 +0100)] 
Merge pull request #31019 from poettering/hostnamed-full-os-release

hostnamed: expose full /etc/os-release data in hostnamectl's --json= output

4 months agoRemove duplicated command in help message
Martin Trigaux [Tue, 23 Jan 2024 06:42:18 +0000 (07:42 +0100)] 
Remove duplicated command in help message

"systemctl reboot" was present twice in the message, should be halt instead

4 months agoMerge pull request #31053 from intelfx/work/machinectl-zsh
Luca Boccassi [Tue, 23 Jan 2024 10:16:51 +0000 (10:16 +0000)] 
Merge pull request #31053 from intelfx/work/machinectl-zsh

shell-completion: improve and expand zsh machinectl completion

4 months agoman/bootctl: typo in `--print-boot-path` description 31057/head
Antonio Alvarez Feijoo [Tue, 23 Jan 2024 09:33:26 +0000 (10:33 +0100)] 
man/bootctl: typo in `--print-boot-path` description

4 months agobootctl: return earlier with `--print-esp-path`
Antonio Alvarez Feijoo [Tue, 23 Jan 2024 09:24:44 +0000 (10:24 +0100)] 
bootctl: return earlier with `--print-esp-path`

`--print-esp-path` and `--print-boot-path` cannot be combined, so it's not
necessary to acquire the XBOOTLDR partition with `--print-esp-path`.

4 months agoshell-completion/zsh: complete hidden images when word starts with "." 31053/head
Ivan Shapovalov [Tue, 23 Jan 2024 00:10:49 +0000 (01:10 +0100)] 
shell-completion/zsh: complete hidden images when word starts with "."

Show hidden images in the completion results, but only if the current
word starts with ".", such that
- `machinectl clone <Tab>` will only offer non-hidden images, but
- `machinectl clone .<Tab>` will offer both hidden and non-hidden images

4 months agoMerge pull request #31015 from yuwata/local-addresses
Yu Watanabe [Tue, 23 Jan 2024 01:25:35 +0000 (10:25 +0900)] 
Merge pull request #31015 from yuwata/local-addresses

local-addresses: several cleanups and fixes, add test cases

4 months agoshell-completion/zsh: improve and expand machinectl completion
Ivan Shapovalov [Sat, 20 Jan 2024 10:45:12 +0000 (11:45 +0100)] 
shell-completion/zsh: improve and expand machinectl completion

4 months agoFix systemd-backlight ignoring numbered kbd_backlight entries
Werner Sembach [Fri, 19 Jan 2024 19:56:15 +0000 (20:56 +0100)] 
Fix systemd-backlight ignoring numbered kbd_backlight entries

If there are name collisions in the leds subsystem, the 2nd device node with the
colliding name gets automatically renamed by appending _1, the third by
appending _2 and so on.

This wildcard change makes sure that systemd-backlight also catches these
renamed nodes for kbd_backlight entries.

4 months agoMerge pull request #31044 from keszybz/uhttpd-alloca-print
Luca Boccassi [Mon, 22 Jan 2024 22:03:08 +0000 (22:03 +0000)] 
Merge pull request #31044 from keszybz/uhttpd-alloca-print

Use macro wrapper instead of alloca in µhttp-utils

4 months agocgroup: Rename effective limits internal table
Michal Koutný [Mon, 22 Jan 2024 15:58:18 +0000 (16:58 +0100)] 
cgroup: Rename effective limits internal table

Post-merge fixup of commit 4fb0d2dc14 ("cgroup: Add EffectiveMemoryMax=,
EffectiveMemoryHigh= and EffectiveTasksMax= properties"), no functional
change intended.

4 months agomeson: correctly handle "no" value for sshd?confdir options
Frantisek Sumsal [Mon, 22 Jan 2024 16:11:14 +0000 (17:11 +0100)] 
meson: correctly handle "no" value for sshd?confdir options

4 months agovmspawn: document -q/--quiet
Sam Leonard [Mon, 22 Jan 2024 18:26:22 +0000 (18:26 +0000)] 
vmspawn: document -q/--quiet

4 months agocore: raise the log priority if sd-executor is missing
Frantisek Sumsal [Mon, 22 Jan 2024 13:15:31 +0000 (14:15 +0100)] 
core: raise the log priority if sd-executor is missing

Log about missing executor at the emergency level, so the message always
makes it to the console - otherwise it won't get anywhere, since we
can't even start systemd-journald in that case.

Before:

Welcome to Arch Linux!

[    5.202479] systemd[1]: Failed to allocate manager object: No such file or directory
[!!!!!!] Failed to allocate manager object.
[    5.207741] systemd[1]: Freezing execution.

After:

Welcome to Arch Linux!

[    5.279408] systemd[1]: Failed to open executor binary '/usr/lib/systemd/systemd-executor': No such file or directory
[    5.290756] systemd[1]: Failed to allocate manager object: No such file or directory
[!!!!!!] Failed to allocate manager object.
[    5.295919] systemd[1]: Freezing execution.

4 months agoMerge pull request #31011 from poettering/getpwnam-tweaks
Lennart Poettering [Mon, 22 Jan 2024 19:58:33 +0000 (20:58 +0100)] 
Merge pull request #31011 from poettering/getpwnam-tweaks

clean up getpwnam() calls and related interfaces

4 months agoIPv6 RA: Support the Retrans Timer field (IPv6 Conformance Test: v6LC.2.1.5)
Matt Muggeridge [Mon, 22 Jan 2024 09:55:41 +0000 (19:55 +1000)] 
IPv6 RA: Support the Retrans Timer field (IPv6 Conformance Test: v6LC.2.1.5)

The RA's Retransmission Timer field was being ignored. This resolves the IPv6
Core Conformance test, v6LC.2.1.5 [1].

Retransmission Timer is a 32-bit unsigned integer. The time, in milliseconds,
between retransmitted Neighbor Solicitation messages. Used by the Address
Resolution and Neighbor Unreachability Detection (NUD) algorithm.

Support setting a default value for the neighbour retransmission timer value with:

    [Network]
    IPv6RetransmissionTimeSec=<int>

By default, upon receiving a Router Advertisement with the Retransmission Timer
field set to a non-zero value, it will update the kernel's retransmit timer value.
To disable this behaviour, configure the UseIPv6RetransmissionTime= under the
[IPv6AcceptRA] section.

    [IPv6AcceptRA]
    UseIPv6RetransmissionTime=<bool>

RFC4861: Neighbor Discovery in IPv6
  * Section 4.2 RA Message Format.
  * Section 6.3.4 Processing Received Router Advertisements

A Router Advertisement field (e.g., Cur Hop Limit, Reachable Time,
and Retrans Timer) may contain a value denoting that it is
unspecified. In such cases, the parameter should be ignored and the
host should continue using whatever value it is already using. In
particular, a host MUST NOT interpret the unspecified value as
meaning change back to the default value that was in use before the
first Router Advertisement was received.

The RetransTimer variable SHOULD be copied from the Retrans Timer
field, if the received value is non-zero.

References
[1] IPv6 Core Conformance Spec (PDF)

4 months agouser-util: add get{pw,gr}{uid,gid,name}_malloc() helpers 31011/head
Lennart Poettering [Fri, 19 Jan 2024 10:38:54 +0000 (11:38 +0100)] 
user-util: add get{pw,gr}{uid,gid,name}_malloc() helpers

These are wrappers around getpwuid_r() and friends, and will allocate the
right-sized buffer for this call.

We so far had multiple implementations of a buffer allocation loop
around getpwuid_r() and friends, and they all suck in some way. Let's
clean this up and add a common implementation, and use it everywhere.

Also, be more careful with error numbers, in particular systematically
turn ENOENT into ENOSRCH (the former is what is returned if /etc/passwd
is absent, which we want to consider identical to user not existing,
which is ENOSRCH). We so far did this at some invocations, but not all.

There are some invocations of getpwuid() left in the codebase. We really
should fix those too, and have a single unified implementation of the
logic, but those are not as trivial to convert, so left for another
time.

4 months agouser-util: validate the right field
Lennart Poettering [Fri, 19 Jan 2024 10:32:26 +0000 (11:32 +0100)] 
user-util: validate the right field

4 months agoMerge pull request #31023 from poettering/vmspawn-work
Lennart Poettering [Mon, 22 Jan 2024 16:54:43 +0000 (17:54 +0100)] 
Merge pull request #31023 from poettering/vmspawn-work

vmspawn: make it work on current fedora

4 months agonspawn,vmspawn: let's add some terminal magic to the welcome text 31023/head
Lennart Poettering [Fri, 19 Jan 2024 22:23:48 +0000 (23:23 +0100)] 
nspawn,vmspawn: let's add some terminal magic to the welcome text

Let's grey the text out, and prefix it with a vertical grey bar, to make
clear this is output from the host, not the payload, and make it clearly
distinguishable from what follows.

Let's also make the image name clickable (with new enough
shared-mime-info this should allow you to look into the image with
gnome-disk-utility or a similar tool.

4 months agovmspawn: make "-m" value formatting independent of locale
Lennart Poettering [Fri, 19 Jan 2024 22:12:05 +0000 (23:12 +0100)] 
vmspawn: make "-m" value formatting independent of locale

We cannot format the memory string via printf() %f format strings, since
that's locale dependent and qemu doesn't like that. hence format this as
an integer. We'll lose sub-MiB accuracy, but systems with less than 1
MiB memory don't really make much sense anyway.

4 months agovmspawn: print a helpful message when we start the VM
Lennart Poettering [Fri, 19 Jan 2024 18:32:36 +0000 (19:32 +0100)] 
vmspawn: print a helpful message when we start the VM

Let people know how they can exit the VM, it's not obvious after all.

4 months agovmspawn: make sure to pass the right firmware image type to qemu
Lennart Poettering [Fri, 19 Jan 2024 18:14:09 +0000 (19:14 +0100)] 
vmspawn: make sure to pass the right firmware image type to qemu

The JSON data reports whether firmware types are qcow or raw. Let's pass
that into the qemu cmdline.

4 months agovmspawn: rework firmware selection logic
Lennart Poettering [Fri, 19 Jan 2024 17:50:43 +0000 (18:50 +0100)] 
vmspawn: rework firmware selection logic

Let's make the firmware file to choose configurable, and enumeratable.

This adds --firmware= to select the formare, and in particular
--firmware=list to show available options.

4 months agoman: document new rootfs support for pcrlock policies 30130/head
Lennart Poettering [Tue, 21 Nov 2023 21:07:59 +0000 (22:07 +0100)] 
man: document new rootfs support for pcrlock policies

4 months agotest: add new credential-based pcrlock policy unlock
Lennart Poettering [Tue, 21 Nov 2023 20:45:47 +0000 (21:45 +0100)] 
test: add new credential-based pcrlock policy unlock

4 months agopcrlock: when unlocking try to pick up pcrlock policy from system credentials
Lennart Poettering [Tue, 21 Nov 2023 10:44:34 +0000 (11:44 +0100)] 
pcrlock: when unlocking try to pick up pcrlock policy from system credentials

4 months agopcrlock: also write pcrlock policy as unencrypted credential to XBOOTLDR/ESP
Lennart Poettering [Mon, 20 Nov 2023 17:01:40 +0000 (18:01 +0100)] 
pcrlock: also write pcrlock policy as unencrypted credential to XBOOTLDR/ESP

4 months agohostnamectl: add -j switch for quick json output 31019/head
Lennart Poettering [Fri, 19 Jan 2024 14:49:33 +0000 (15:49 +0100)] 
hostnamectl: add -j switch for quick json output

We already support -j as shortcut for JSON mode in various tools. Let's
add one more. We probably should add this systematically (at least where
it doesn't conflict with an existing -j switch with other purpose). But
I am too lazy to add that now.

4 months agohostnamed: expose /etc/os-release and /etc/machine-info data in full
Lennart Poettering [Fri, 19 Jan 2024 14:42:58 +0000 (15:42 +0100)] 
hostnamed: expose /etc/os-release and /etc/machine-info data in full

There's some appetite to have the full os-release/machine-info data
exposed by hostnamed.

let's do so in the Describe() method and via Varlink. It's trivial after
all.

Inspired by: #18649

4 months agovmspawn: ENODEV is not the only error the kernel returns if a device is not there
Lennart Poettering [Fri, 19 Jan 2024 17:47:41 +0000 (18:47 +0100)] 
vmspawn: ENODEV is not the only error the kernel returns if a device is not there

Let's use ERRNO_IS_DEVICE_ABSENT() to cover all cases.

(And while we are at it also use ERRNO_IS_PRIVILEGE() where appropriate)

4 months agovmspawn: close host vsock fd once we passed it to the child
Lennart Poettering [Fri, 19 Jan 2024 17:05:32 +0000 (18:05 +0100)] 
vmspawn: close host vsock fd once we passed it to the child

Without this I qemu simply froze in a weird state for me if I kill it:
it was supposedly a zombie, but we'd get the pidfd POLLIN event for it
only once the fd is closed. Hence let's close it right-away.

(Smells like a kernel issue actually, but too lazy to bother with this).

4 months agovmspawn: use execv() rather than execve() if we just want to pass 'environ' as env...
Lennart Poettering [Fri, 19 Jan 2024 17:05:28 +0000 (18:05 +0100)] 
vmspawn: use execv() rather than execve() if we just want to pass 'environ' as env block

4 months agovmspawn: modernize setup_notify_parent() a bit
Lennart Poettering [Fri, 19 Jan 2024 17:04:56 +0000 (18:04 +0100)] 
vmspawn: modernize setup_notify_parent() a bit

4 months agovmspawn: rework how we spawn qemu off
Lennart Poettering [Fri, 19 Jan 2024 17:03:49 +0000 (18:03 +0100)] 
vmspawn: rework how we spawn qemu off

Let's swicth to PidRef for tracking the qemu child.

let's also set a bunch of flags that ensure the child inherits less of
of context.

4 months agoevent-util: add helper for adding pidref child to event loop
Lennart Poettering [Fri, 19 Jan 2024 17:02:19 +0000 (18:02 +0100)] 
event-util: add helper for adding pidref child to event loop

4 months agomkosi: Use authselect local profile if it exists
Daan De Meyer [Mon, 22 Jan 2024 11:04:45 +0000 (12:04 +0100)] 
mkosi: Use authselect local profile if it exists

authselect 1.5.0 removed the "minimal" profile and added the "local"
profile instead. Let's modify our post-installation script to take
these changes into account.

4 months agotree-wide: link to docs.kernel.org for kernel documentation
nl6720 [Sun, 21 Jan 2024 11:48:16 +0000 (13:48 +0200)] 
tree-wide: link to docs.kernel.org for kernel documentation

https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
These URLs are shorter and nicer looking.

4 months agopo: Translated using Weblate (Indonesian)
Andika Triwidada [Sun, 21 Jan 2024 10:36:51 +0000 (11:36 +0100)] 
po: Translated using Weblate (Indonesian)

Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Andika Triwidada <andika@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/id/
Translation: systemd/main

4 months agocore: path: Re-enter waiting if target is deactivating 30490/head
Adrian Vovk [Sat, 30 Dec 2023 19:06:39 +0000 (14:06 -0500)] 
core: path: Re-enter waiting if target is deactivating

Previously, path units would remain in the running state while their
target unit is deactivating. This left a window of time where the target
unit is no longer operational (i.e. it is busy deactivating/cleaning
up/etc) but the path unit would continue to ignore inotify events. In
short: any inotify event that occurs while the target unit deactivates
would be completely lost.

With this commit, the path will go back into a waiting state when the
target unit starts deactivating. This means that any inotify event that
occurs while the target unit deactivates will queue a start job.

4 months agonetwork/route: update MTU of IPv6 route even if the kernel returns -EEXIST
Yu Watanabe [Sat, 20 Jan 2024 06:55:06 +0000 (15:55 +0900)] 
network/route: update MTU of IPv6 route even if the kernel returns -EEXIST

4 months agoMerge pull request #31004 from AdrianVovk/misc-cleanups
Mike Yuan [Sat, 20 Jan 2024 08:43:20 +0000 (16:43 +0800)] 
Merge pull request #31004 from AdrianVovk/misc-cleanups

Misc cleanups

4 months agotest-local-addresses: add more test cases 31015/head
Yu Watanabe [Fri, 19 Jan 2024 13:34:22 +0000 (22:34 +0900)] 
test-local-addresses: add more test cases

4 months agolocal-addresses: introduce has_local_address() helper function
Yu Watanabe [Fri, 19 Jan 2024 13:33:36 +0000 (22:33 +0900)] 
local-addresses: introduce has_local_address() helper function

It will be used later.

4 months agosd-netlink: drop unused parser for RTA_MULTIPATH
Yu Watanabe [Fri, 19 Jan 2024 11:16:59 +0000 (20:16 +0900)] 
sd-netlink: drop unused parser for RTA_MULTIPATH

4 months agolocal-addresses: introduce own parser for RTA_MULTIPATH
Yu Watanabe [Fri, 19 Jan 2024 11:14:08 +0000 (20:14 +0900)] 
local-addresses: introduce own parser for RTA_MULTIPATH

4 months agolocal-addresses: also save weight of multipath routes
Yu Watanabe [Fri, 19 Jan 2024 11:12:09 +0000 (20:12 +0900)] 
local-addresses: also save weight of multipath routes

4 months agolocal-addresses: introduce generic setter add_local_addresses_full()
Yu Watanabe [Fri, 19 Jan 2024 11:08:06 +0000 (20:08 +0900)] 
local-addresses: introduce generic setter add_local_addresses_full()

4 months agolocal-addresses: RTA_OIF and RTA_MULTIPATH are exclusive
Yu Watanabe [Fri, 19 Jan 2024 11:07:17 +0000 (20:07 +0900)] 
local-addresses: RTA_OIF and RTA_MULTIPATH are exclusive

4 months agolocal-addresses: fix memleak of 'multipath_routes'
Yu Watanabe [Fri, 19 Jan 2024 11:04:01 +0000 (20:04 +0900)] 
local-addresses: fix memleak of 'multipath_routes'

Also reduces scopes of some variables.

4 months agolocal-addresses: always sort and dedup even if addresses are not requested
Yu Watanabe [Fri, 19 Jan 2024 10:47:29 +0000 (19:47 +0900)] 
local-addresses: always sort and dedup even if addresses are not requested

Otherwise, the return value may different when ret is NULL or not.

4 months agolocal-addresses: ignore tentative addresses
Yu Watanabe [Fri, 19 Jan 2024 10:44:49 +0000 (19:44 +0900)] 
local-addresses: ignore tentative addresses

As tentative addresses may be dropped soon if DAD failed.

4 months agolocal-addresses: check family more
Yu Watanabe [Fri, 19 Jan 2024 10:43:26 +0000 (19:43 +0900)] 
local-addresses: check family more

Just for safety. No functional change, unless the kernel sends broken
messages.

4 months agolocal-addresses: rename metric -> priority
Yu Watanabe [Fri, 19 Jan 2024 10:24:45 +0000 (19:24 +0900)] 
local-addresses: rename metric -> priority

To make it consistent with the netlink attribute RTA_PRIORITY.

4 months agotest-local-addresses: several modernization
Yu Watanabe [Fri, 19 Jan 2024 10:35:57 +0000 (19:35 +0900)] 
test-local-addresses: several modernization

- use size_t for number of addresses,
- use FOREACH_ARRAY() macro,
- use IN_ADDR_TO_STRING() macro, etc.

4 months agoptyfwd: when leaving a session with tinted background, clear to end of screen
Lennart Poettering [Fri, 19 Jan 2024 22:39:13 +0000 (23:39 +0100)] 
ptyfwd: when leaving a session with tinted background, clear to end of screen

So if we tint the background of a ptyfwd session with a color and the
session ends, then so far we reset the bg color and clear till the end
of line.

Let's instead clear till the end of the screen. This is nicer since it
means that any follow-up output will not be affected by the changed
background color anymore.