]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
3 months agoMerge pull request #31083 from yuwata/core-several-cleanups
Yu Watanabe [Thu, 25 Jan 2024 20:30:01 +0000 (05:30 +0900)] 
Merge pull request #31083 from yuwata/core-several-cleanups

core: several cleanups

3 months agoMerge pull request #31090 from poettering/bpf-lsm-rename
Luca Boccassi [Thu, 25 Jan 2024 18:20:25 +0000 (18:20 +0000)] 
Merge pull request #31090 from poettering/bpf-lsm-rename

rename a bunch of bpf related .c/.h files, and functions there in to make naming of systematic

3 months agodissect: add --make-archive option to convert DDI to tarball
Lennart Poettering [Wed, 24 Jan 2024 11:28:41 +0000 (12:28 +0100)] 
dissect: add --make-archive option to convert DDI to tarball

3 months agoman: Document ranges for distributions config files and local config files
Daan De Meyer [Wed, 24 Jan 2024 11:24:11 +0000 (12:24 +0100)] 
man: Document ranges for distributions config files and local config files

Let's recommend that config files and drop-ins in /usr use the range
0-49 and config files in /etc and /run use the range 50-99 so that
files in /run and /etc will generally always override files from
/usr.

3 months agoMerge pull request #31089 from keszybz/drop-syscall-filtering-and-new-syscalls
Lennart Poettering [Thu, 25 Jan 2024 16:12:13 +0000 (17:12 +0100)] 
Merge pull request #31089 from keszybz/drop-syscall-filtering-and-new-syscalls

Drop syscall filtering and add new syscalls

3 months agocore: introduce unit_unwatch_pidref_done() helper function 31083/head
Yu Watanabe [Wed, 24 Jan 2024 07:11:28 +0000 (16:11 +0900)] 
core: introduce unit_unwatch_pidref_done() helper function

No functional change, just refactoring.

3 months agocore/unit: split out unit_kill_one()
Yu Watanabe [Thu, 25 Jan 2024 07:41:37 +0000 (16:41 +0900)] 
core/unit: split out unit_kill_one()

This also renames 'error' -> 'ret_error'.

No functional change, just refactoring.

3 months agocore/unit: split out unit_kill_context_one()
Yu Watanabe [Wed, 24 Jan 2024 06:27:52 +0000 (15:27 +0900)] 
core/unit: split out unit_kill_context_one()

No functional change, just refactoring.

3 months agoMerge pull request #31082 from yuwata/network-cleanups-for-removing-routes
Lennart Poettering [Thu, 25 Jan 2024 15:24:19 +0000 (16:24 +0100)] 
Merge pull request #31082 from yuwata/network-cleanups-for-removing-routes

network: several cleanups for removing routes

3 months agoupdate TODO 31090/head
Lennart Poettering [Thu, 25 Jan 2024 13:06:37 +0000 (14:06 +0100)] 
update TODO

3 months agobpf-socket-bind: rename bpf_serialize_socket_bind() → bpf_socket_bind_serialize()
Lennart Poettering [Thu, 25 Jan 2024 13:06:59 +0000 (14:06 +0100)] 
bpf-socket-bind: rename bpf_serialize_socket_bind() → bpf_socket_bind_serialize()

This function is the only outlier, all other BPF glue functions are
called bpf_<module>_xyz(). Hence swap this over here too.

3 months agocore: rename restrict-ifaces.[ch] → bpf-restrict-ifaces.[ch]
Lennart Poettering [Thu, 25 Jan 2024 13:02:24 +0000 (14:02 +0100)] 
core: rename restrict-ifaces.[ch] → bpf-restrict-ifaces.[ch]

Let's also clean-up naming of the "restrict-ifaces" BPF code. Let's name
the userspace glue analogous to the actual bpf code in src/core/bpf.

3 months agobpf-restrict-fs: also rename functions to bpf_restrict_fs_xyz()
Lennart Poettering [Thu, 25 Jan 2024 12:56:32 +0000 (13:56 +0100)] 
bpf-restrict-fs: also rename functions to bpf_restrict_fs_xyz()

Rename the functions too, to make clear this is really just about the
restrict-fs, and not generic LSM_BPF code.

3 months agoloop-util: drop unused .uevent_seqnum_not_before and .timestamp_not_before fields
Franck Bui [Thu, 25 Jan 2024 08:53:21 +0000 (09:53 +0100)] 
loop-util: drop unused .uevent_seqnum_not_before and .timestamp_not_before fields

3 months agoMerge pull request #31087 from YHNdnzj/logind-cleanup
Lennart Poettering [Thu, 25 Jan 2024 14:47:56 +0000 (15:47 +0100)] 
Merge pull request #31087 from YHNdnzj/logind-cleanup

logind: several cleanups

3 months agocore: rename "bpf-lsm.[ch]" → "bpf-restrict-fs.[ch]"
Lennart Poettering [Thu, 25 Jan 2024 12:41:46 +0000 (13:41 +0100)] 
core: rename "bpf-lsm.[ch]" → "bpf-restrict-fs.[ch]"

This file is a bit misnamed. What it actually implements is one specific
BPF LSM module, that restricts file systems. As such it really should be
named after that, and not primarily by the mechanism it uses for that.

With this our glue code is now named the same way as the actual bpf code
files in src/core/bpf/, thus things become a bit more symmetric.

This is particular relevant as we'll soon have another BPF LSM in our
tree, see #26826, and we should be able to distinguish them by name.

This commit just renames the files and does some dumb search/replace of
the string. A follow-up commit will name some functions more expressively
inside the files.

3 months agoUpdate syscalls lists 31089/head
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 12:45:14 +0000 (13:45 +0100)] 
Update syscalls lists

For discussion of listmount() and statmount(), see
https://lwn.net/Articles/950569/.

3 months agomeson: drop arch filtering in syscall list
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 12:26:21 +0000 (13:26 +0100)] 
meson: drop arch filtering in syscall list

I added the filtering in 752fedbea7c02c82287c7ff2a4139f528b3f7ba8 as a way
to reduce the number of items in the tables. I thought it's "obvious", but
it might not be so.

One immediate problem is that the filter is broken, because on arm64,
os.uname().machine returns "aarch64", so we incorrectly filter out the arm
syscalls (there is just one: arm_fadvise64_64). Of course we could fix the
filter, but I think it's better to nuke it altogether. The filter on applies to
1 arm syscall and 5 s390 syscalls, and we have 500+ other syscalls, so this
"optimization" doesn't really matter. OTOH, if we get the filter wrong,
the result is bad. And also, the existence of the filter at all creates
problems for cross-builds.

I wanted to get rid of 'generate-syscall-list.py', but we need to generate a
backslash in the output. https://github.com/mesonbuild/meson/issues/1564 makes
this very very hard, since any attempt to put a backslash an inline argument
results in the backslash being replaces by a forward slash, which doesn't quite
have the same meaning. So let's use a standalone script until
https://github.com/mesonbuild/meson/issues/1564 is resolved.

3 months agomeson: use a single line for one-item file lists
Zbigniew Jędrzejewski-Szmek [Thu, 25 Jan 2024 12:23:25 +0000 (13:23 +0100)] 
meson: use a single line for one-item file lists

That file was mixing two styles, which looks ugly. Let's not make
the file unnecessarily long.

3 months agocgroup: don't enable bpf pseudo-controllers when doing a wildcard delegation
Lennart Poettering [Wed, 24 Jan 2024 21:40:04 +0000 (22:40 +0100)] 
cgroup: don't enable bpf pseudo-controllers when doing a wildcard delegation

We can only delegate actual controllers, not the BPF pseudo-controllers
we defined as there's imply no concept for that. Hence, when users set
Delegate=yes to do a wildcard delegation, only delegate the regular
controllers.

This means that we won't bother with BPF stuff for such units where it's
entirelly unnecessary.

3 months agouser-util: add comments explaining what the user name size limits effectively mean
Lennart Poettering [Wed, 24 Jan 2024 21:39:33 +0000 (22:39 +0100)] 
user-util: add comments explaining what the user name size limits effectively mean

3 months agologind-user: don't clear individual fields if object is freed anyway 31087/head
Mike Yuan [Thu, 25 Jan 2024 09:29:50 +0000 (17:29 +0800)] 
logind-user: don't clear individual fields if object is freed anyway

3 months agologind-dbus: send session reply only for user start jobs
Mike Yuan [Thu, 25 Jan 2024 10:27:40 +0000 (18:27 +0800)] 
logind-dbus: send session reply only for user start jobs

3 months agologind-dbus: modernize method_set_user_linger
Mike Yuan [Thu, 18 Jan 2024 07:28:39 +0000 (15:28 +0800)] 
logind-dbus: modernize method_set_user_linger

Currently, user_start() doesn't return any error,
but let's not eat up the return value.
Preparation for #30910, after which user_start()
does return error.

3 months agologind-user: don't say "user X logged out" in user_finalize
Mike Yuan [Wed, 24 Jan 2024 13:56:56 +0000 (21:56 +0800)] 
logind-user: don't say "user X logged out" in user_finalize

"Logging out" is something done by the human user. When we stop
tracking/GC a User object, let's use a more generic phrase in case
the specific User doesn't have human users (i.e. "user" class sessions)
at all. Eventually we want something like #2900, and log this
when all user class sessions log out and we're lingering again I think.

3 months agoSort input file list
Bernhard M. Wiedemann [Thu, 25 Jan 2024 04:48:35 +0000 (05:48 +0100)] 
Sort input file list

so that /usr/lib/systemd/tests/unit-tests/test-libsystemd-sym
builds in a reproducible way
in spite of non-deterministic filesystem readdir order

See https://reproducible-builds.org/ for why this is good.

This patch was done while working on reproducible builds for openSUSE.

3 months agotest-network: check if networkd forgets routes silently removed by the kernel 31082/head
Yu Watanabe [Tue, 16 Jan 2024 03:47:40 +0000 (12:47 +0900)] 
test-network: check if networkd forgets routes silently removed by the kernel

3 months agonetwork/nexthop: drop dependent routes on removal
Yu Watanabe [Tue, 16 Jan 2024 03:01:50 +0000 (12:01 +0900)] 
network/nexthop: drop dependent routes on removal

If a nexthop is removed, dependent routes are silently removed by the kernel.
Hence, networkd may be confused that routes that depends on the nexthop still
exist, and may fail to configure other routes or so.

This is the one for routes of 3cbbe8635a16f096a3b0eff993f7681401535605.

3 months agonetwork/route: introduce reverse map for route with nexthop ID
Yu Watanabe [Mon, 15 Jan 2024 04:02:16 +0000 (13:02 +0900)] 
network/route: introduce reverse map for route with nexthop ID

It is not used in this commit, but will be used later.
Preparation for later commits.

This is the one for routes of 531c7246829a41dd7e51847bd4d77aa012ff478f.

3 months agonetwork/route: also remove route on cancelling request
Yu Watanabe [Sat, 6 Jan 2024 21:11:09 +0000 (06:11 +0900)] 
network/route: also remove route on cancelling request

Otherwise, the route may arrive after we call
link_drop_foreign_address() or so on reconfiguring interface.

This is the one for routes of 4303e9806befc0c5b8067e45225e5d952f427b3a.

3 months agonetwork/route: drop Route object even if we fail to remove the route
Yu Watanabe [Sun, 7 Jan 2024 05:41:56 +0000 (14:41 +0900)] 
network/route: drop Route object even if we fail to remove the route

If we could not remove a route, then previously the corresponding
Route object was never removed, as it was freed only when we receive
remove notification from the kernel. So, we might confused that the
route still exists and being removed, and might block reconfiguring
the route.

With this change, even if we fail to remove a route, the corresponding
Route object will be freed.

This is the one for routes of 56a995fe8e50b2432ff930ed0431cc70adbe492d.

3 months agonetwork/route: introduce ref/unref functions for Route object
Yu Watanabe [Sun, 7 Jan 2024 06:16:03 +0000 (15:16 +0900)] 
network/route: introduce ref/unref functions for Route object

Then, Route object can live if it is detached from the owner (Manager,
Network, or Wireguard object).

This is the one for routes of ebd96906477aac2bbc6b9de0d6e9bd0f39db5581.

3 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.

3 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)

3 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.

3 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.

3 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

3 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.

3 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.

3 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.

3 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.

3 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.

3 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

3 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

3 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

3 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.

3 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

3 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

3 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

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

3 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.

3 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

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

3 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

3 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

3 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>
3 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

3 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

3 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.

3 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.

3 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.

3 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

3 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.

3 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).

3 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.

3 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
...

3 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.

3 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

3 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.

3 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

3 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()

3 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

3 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`

3 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()

3 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

3 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

3 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

3 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

3 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

3 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

3 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`.

3 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

3 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

3 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

3 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.

3 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

3 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.

3 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

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

3 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.

3 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

3 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)

3 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.

3 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

3 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

3 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.

3 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.

3 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.

3 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.

3 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.