]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
15 months agotest: add test for journalctl --list-invocations and --invocation= 32448/head
Yu Watanabe [Sun, 12 May 2024 07:15:22 +0000 (16:15 +0900)] 
test: add test for journalctl --list-invocations and --invocation=

15 months agojournalctl: add --list-invocations command and -I/--invocation options
Yu Watanabe [Thu, 25 Apr 2024 04:38:24 +0000 (13:38 +0900)] 
journalctl: add --list-invocations command and -I/--invocation options

The --list-invocations command is similar to --list-boots, but shows
invocation IDs of specified unit. This should be useful when showing
a specific invocation of a unit.

The --invocation option is similar to --boot, but takes a invocation ID
or an offset. The -I option is equivalent to --invocation=0.

15 months agologs-show: extend journal_get_boots() and friends to find invocation IDs
Yu Watanabe [Thu, 25 Apr 2024 06:28:19 +0000 (15:28 +0900)] 
logs-show: extend journal_get_boots() and friends to find invocation IDs

Currently the extended features are not used, but will be used later.

15 months agologs-show: introduce several helper functions
Yu Watanabe [Thu, 25 Apr 2024 06:27:43 +0000 (15:27 +0900)] 
logs-show: introduce several helper functions

Currently these are not used, but will be used later.

15 months agouse int64_t for index in show_log_ids()
Yu Watanabe [Sat, 22 Jun 2024 08:45:57 +0000 (17:45 +0900)] 
use int64_t for index in show_log_ids()

15 months agojournalctl: split out show_log_ids() from action_list_boots()
Yu Watanabe [Thu, 25 Apr 2024 04:15:49 +0000 (13:15 +0900)] 
journalctl: split out show_log_ids() from action_list_boots()

No functional change, just refactoring and prepraration for later change.

15 months agojournalctl: update log messages
Yu Watanabe [Wed, 31 Jul 2024 02:27:28 +0000 (11:27 +0900)] 
journalctl: update log messages

15 months agologs-show: rename BootId -> LogId
Yu Watanabe [Thu, 25 Apr 2024 01:10:39 +0000 (10:10 +0900)] 
logs-show: rename BootId -> LogId

The struct itself is generic, and can be used for other ID.
Let's rename it to more generic one.
No functional change, just refactoring and preparation for later
commits.

15 months agoMerge pull request #33886 from DaanDeMeyer/autologin
Daan De Meyer [Wed, 31 Jul 2024 18:21:12 +0000 (20:21 +0200)] 
Merge pull request #33886 from DaanDeMeyer/autologin

Two mkosi improvements

15 months agoMerge pull request #33885 from DaanDeMeyer/pidref-kthread
Daan De Meyer [Wed, 31 Jul 2024 17:07:35 +0000 (19:07 +0200)] 
Merge pull request #33885 from DaanDeMeyer/pidref-kthread

Two pidfd fixes

15 months agomkosi: Beef up testuser a bit 33886/head
Daan De Meyer [Wed, 31 Jul 2024 15:42:56 +0000 (17:42 +0200)] 
mkosi: Beef up testuser a bit

Give it a password and add it to some common groups.

15 months agomkosi: Switch to autologin via credentials
Daan De Meyer [Wed, 31 Jul 2024 15:38:12 +0000 (17:38 +0200)] 
mkosi: Switch to autologin via credentials

Let's use the newly added credentials to only enable autologin for
/dev/console (systemd-nspawn) and /dev/hvc0 (qemu) instead of enabling
autologin for every tty.

15 months agoMerge pull request #33873 from DaanDeMeyer/rename-creds
Daan De Meyer [Wed, 31 Jul 2024 15:35:58 +0000 (17:35 +0200)] 
Merge pull request #33873 from DaanDeMeyer/rename-creds

core: Add support for renaming credentials with ImportCredential=

15 months agosocket: fix socket activation of stopped services with pinned FD store
Michal Sekletar [Tue, 30 Jul 2024 14:22:03 +0000 (16:22 +0200)] 
socket: fix socket activation of stopped services with pinned FD store

15 months agoMerge pull request #32937 from steelman/github/drop-ambient-caps-executor
Luca Boccassi [Wed, 31 Jul 2024 14:11:30 +0000 (16:11 +0200)] 
Merge pull request #32937 from steelman/github/drop-ambient-caps-executor

core: drop ambient capabilities in systemd-executor

15 months agounits: Import tty specific credentials for each getty unit 33873/head
Daan De Meyer [Tue, 30 Jul 2024 14:22:34 +0000 (16:22 +0200)] 
units: Import tty specific credentials for each getty unit

As explained in the previous commit, this allows us to configure
agetty and login for individual ttys instead of globally.

15 months agocore: Add support for renaming credentials with ImportCredential=
Daan De Meyer [Tue, 30 Jul 2024 14:16:26 +0000 (16:16 +0200)] 
core: Add support for renaming credentials with ImportCredential=

This allows for "per-instance" credentials for units. The use case
is best explained with an example. Currently all our getty units
have the following stanzas in their unit file:

"""
ImportCredential=agetty.*
ImportCredential=login.*
"""

This means that setting agetty.autologin=root as a system credential
will make every instance of our all our getty units autologin as the
root user. This prevents us from doing autologin on /dev/hvc0 while
still requiring manual login on all other ttys.

To solve the issue, we introduce support for renaming credentials with
ImportCredential=. This will allow us to add the following to e.g.
serial-getty@.service:

"""
ImportCredential=tty.serial.%I.agetty.*:agetty.
ImportCredential=tty.serial.%I.login.*:login.
"""

which for serial-getty@hvc0.service will make the service manager read
all credentials of the form "tty.serial.hvc0.agetty.xxx" and pass them
to the service in the form "agetty.xxx" (same goes for login). We can
apply the same to each of the getty units to allow setting agetty and
login credentials for individual ttys instead of globally.

15 months agoexec-credential: Skip duplicate credentials in load_credential_glob()
Daan De Meyer [Wed, 31 Jul 2024 13:02:07 +0000 (15:02 +0200)] 
exec-credential: Skip duplicate credentials in load_credential_glob()

We document that when multiple credentials of the same name are found,
we use the first one found so let's actually implement that behavior.

15 months agoexec-credential: Log if we skip duplicate credential
Daan De Meyer [Wed, 31 Jul 2024 13:01:40 +0000 (15:01 +0200)] 
exec-credential: Log if we skip duplicate credential

15 months agoDrop EEXIST handling in load_credential_glob()
Daan De Meyer [Wed, 31 Jul 2024 13:21:17 +0000 (15:21 +0200)] 
Drop EEXIST handling in load_credential_glob()

Credentials are written to a temporary file and renamed to the
destination with renameat() which will replace existing files so
EEXIST should not happen so drop the handling for EEXIST.

15 months agoMerge pull request #33884 from DaanDeMeyer/log-context
Daan De Meyer [Wed, 31 Jul 2024 12:23:08 +0000 (14:23 +0200)] 
Merge pull request #33884 from DaanDeMeyer/log-context

log: Fix size calculation for number of iovecs

15 months agocgroup-util: Don't try to open pidfd for kernel threads 33885/head
Daan De Meyer [Wed, 31 Jul 2024 11:38:50 +0000 (13:38 +0200)] 
cgroup-util: Don't try to open pidfd for kernel threads

The kernel might start returning -EINVAL when trying to open pidfd's
for kernel threads so let's not try to open pidfd's for kernel threads.

15 months agoMerge pull request #33882 from bluca/efi_proto_fallback_memory
Daan De Meyer [Wed, 31 Jul 2024 11:46:41 +0000 (13:46 +0200)] 
Merge pull request #33882 from bluca/efi_proto_fallback_memory

stub: allocate and zero enough space in legacy x86 handover protocol

15 months agolog: Fix size calculation for number of iovecs 33884/head
Daan De Meyer [Wed, 31 Jul 2024 09:39:04 +0000 (11:39 +0200)] 
log: Fix size calculation for number of iovecs

Each log context field can expand to up to three iovecs (key, value
and newline) so let's fix the size calculation to take this into
account.

15 months agoexecute: Drop log level to unit log level in exec_spawn()
Daan De Meyer [Wed, 31 Jul 2024 11:11:51 +0000 (13:11 +0200)] 
execute: Drop log level to unit log level in exec_spawn()

All messages logged from exec_spawn() are attributed to the unit
and as such we should set the log level to the unit's max log level
for the duration of the function.

15 months agoRevert "execute: Call capability_ambient_set_apply even if ambient set is 0" 32937/head
Łukasz Stelmach [Tue, 28 May 2024 14:56:03 +0000 (16:56 +0200)] 
Revert "execute: Call capability_ambient_set_apply even if ambient set is 0"

With ambient capabilities being dropped at the start of process managers
(both system and user) as well as systemd-executor it isn't necessary
to drop them here. Moreover, at this point also the inheritable set can
be preserved. This makes it possible to assign a user session manager
inheritable capabilities which combined with file capabilites (ei sets)
of service executables enable running user services with capabilities
but only when started by the manager.

This reverts commit 943800f4e7728feb2416dd57b8c296614497b94f.

15 months agocore: drop ambient capabilities in systemd-executor
Łukasz Stelmach [Mon, 20 May 2024 14:51:55 +0000 (16:51 +0200)] 
core: drop ambient capabilities in systemd-executor

Since the commit 963b6b906e ("core: drop ambient capabilities in
user manager") systemd running as the session manager has dropped ambient
capabilities retaining other sets allowing user services to be started
with elevated capabilities. This, worked fine until the introduction of
sd-executor. For a non-root process to be started with elevated
capabilities by a non-root parent it either needs file capabilities or
ambient capabilities in the parent process. Thus, systemd needs to allow
sd-executor to inherit its ambient capabilities and sd-executor should
drop them as systemd did before.

The ambient set is managed for both system and session managers, but
with the default set for PID#1 being empty, this code does not affect
operation of PID#1.

Fixes: bb5232b6a3 ("core: add systemd-executor binary")
15 months agoman: suggest to enable global IPv6Forwarding= setting to make IPv6 packets forwarded
Yu Watanabe [Sun, 23 Jun 2024 20:03:58 +0000 (05:03 +0900)] 
man: suggest to enable global IPv6Forwarding= setting to make IPv6 packets forwarded

Closes #33414.

15 months agoNEWS: mention that udevadm test and test-builtin are now non-destructive
Yu Watanabe [Tue, 30 Jul 2024 22:31:21 +0000 (07:31 +0900)] 
NEWS: mention that udevadm test and test-builtin are now non-destructive

Follow-up for 089bef66316e5bdc91b9984148e5a6455449c1da.
Prompted by https://github.com/systemd/systemd/issues/33619#issuecomment-2257576579.

15 months agonetwork: mention that IPv4 ACD is enabled by default for 169.254.0.0/16
Yu Watanabe [Tue, 30 Jul 2024 22:21:09 +0000 (07:21 +0900)] 
network: mention that IPv4 ACD is enabled by default for 169.254.0.0/16

Prompted by #33824.

15 months agonetwork: request non-NULL SSID when a wlan interface is configured as station
Yu Watanabe [Tue, 30 Jul 2024 21:49:32 +0000 (06:49 +0900)] 
network: request non-NULL SSID when a wlan interface is configured as station

To avoid conflicts with user .network file for the wlan interface with Bond=.
See https://github.com/systemd/systemd/issues/19832#issuecomment-857661200.

15 months agoMerge pull request #33878 from yuwata/network-bind-carrier
Yu Watanabe [Wed, 31 Jul 2024 01:05:43 +0000 (10:05 +0900)] 
Merge pull request #33878 from yuwata/network-bind-carrier

network: several cleanups for BindCarrier= setting

15 months agoMerge pull request #33875 from yuwata/network-link-get-address
Yu Watanabe [Wed, 31 Jul 2024 01:05:11 +0000 (10:05 +0900)] 
Merge pull request #33875 from yuwata/network-link-get-address

network: several fixlets related to link_get_address()

15 months agoefi: fix link to legacy EFI handover protocol 33882/head
Luca Boccassi [Wed, 31 Jul 2024 00:46:58 +0000 (01:46 +0100)] 
efi: fix link to legacy EFI handover protocol

15 months agostub: allocate and zero enough space in legacy x86 handover protocol
Luca Boccassi [Wed, 31 Jul 2024 00:45:06 +0000 (01:45 +0100)] 
stub: allocate and zero enough space in legacy x86 handover protocol

A PE image's memory footprint might be larger than its file size due
to uninitialized memory sections. Normally all PE headers should be
parsed to check the actual required size, but the legacy EFI handover
protocol is only used for x86 Linux bzImages, so we know only the last
section will require extra memory. Use SizeOfImage from the PE header
and if it is larger than the file size, allocate and zero extra memory
before using it.

Fixes https://github.com/systemd/systemd/issues/33816

15 months agonetwork: shorten code a bit 33878/head
Yu Watanabe [Tue, 30 Jul 2024 18:55:37 +0000 (03:55 +0900)] 
network: shorten code a bit

15 months agonetwork: call link_handle_bound_by_list() before trying to reconfigure interface
Yu Watanabe [Tue, 30 Jul 2024 18:50:55 +0000 (03:50 +0900)] 
network: call link_handle_bound_by_list() before trying to reconfigure interface

Otherwise, when an interface gained its carrier, the interface may not
have matching .network file yet, then link_reconfigure_impl() returns
zero, and link_handle_bound_by_list() is skipped.

Fixes #33837.

15 months agoRevert "network/ndisc: ignore most fields of RA header when lifetime is zero"
Ivan Shapovalov [Sun, 16 Jun 2024 08:46:34 +0000 (10:46 +0200)] 
Revert "network/ndisc: ignore most fields of RA header when lifetime is zero"

This reverts commit ffef01acddcac27caaef02f7f28bff03d7799e5e.

Similar to 2d393b1b6d8 ("network: IPv6 Compliance: Router Advertisement
Processing, Reachable Time [v6LC.2.2.15]"),

Extract from: https://www.ietf.org/rfc/rfc4861.html#section-4.2, p.21,
first paragraph:

    The Router Lifetime applies only to
    the router's usefulness as a default router; it
    does not apply to information contained in other
    message fields or options.

So it does not make sense to prevent DHCPv6 when Router Lifetime is 0.

Fixes #33357.

15 months agoFix detection of TDX confidential VM on Azure platform
Daniel P. Berrangé [Tue, 30 Jul 2024 09:51:21 +0000 (10:51 +0100)] 
Fix detection of TDX confidential VM on Azure platform

The original CVM detection logic for TDX assumes that the guest can see
the standard TDX CPUID leaf. This was true in Azure when this code was
originally written, however, current Azure now blocks that leaf in the
paravisor. Instead it is required to use the same Azure specific CPUID
leaf that is used for SEV-SNP detection, which reports the VM isolation
type.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
15 months agotest-network: add test case for preferred source with peer 33875/head
Yu Watanabe [Tue, 30 Jul 2024 16:24:00 +0000 (01:24 +0900)] 
test-network: add test case for preferred source with peer

For issue #31950.

15 months agonetwork: make link_get_address() provide matching address with peer
Yu Watanabe [Tue, 30 Jul 2024 15:59:28 +0000 (00:59 +0900)] 
network: make link_get_address() provide matching address with peer

As all callers do not care if the address has peer address.
This also drops prefixlen argument as it is always zero.

Fixes a bug introduced by 42f8b6a80878e688b821adfb315c0a1f0a7076ce.
Fixes #31950.

15 months agonetwork/ipv4acd: manage ACD engines with Address object
Yu Watanabe [Tue, 30 Jul 2024 15:25:43 +0000 (00:25 +0900)] 
network/ipv4acd: manage ACD engines with Address object

IPv4 addresses are managed with local and peer addresses and prefix
length. So, potentially, the same address with different prefix length
can be assigned on a link, e.g. 192.168.0.1/24 and 192.168.0.1/26.
If one of the address is configured with ACD but the other is not,
then previously ACD might be unexpectedly disabled or enabled on them,
as we managed ACD engines with only local addresses.

This makes ACD engines managed with the corresponding Address objects.

15 months agonetwork: do not bring down bound interfaces immediately
Yu Watanabe [Tue, 30 Jul 2024 18:04:04 +0000 (03:04 +0900)] 
network: do not bring down bound interfaces immediately

Even if a timespan specified to IgnoreCarrierLoss= for an interface,
when the carrier of the interface lost, bound interfaces might be bring
down immediately.

Let's also postpone bringing down bound interfaces with the specified
timespan.

15 months agodocument how TimeoutStartSec= affects notify-reload (#33653)
Arian van Putten [Tue, 30 Jul 2024 11:35:52 +0000 (13:35 +0200)] 
document how TimeoutStartSec=  affects notify-reload (#33653)

* document how TimeoutStartSec=  affects notify-reload

15 months agonspawn: remove macvlan interfaces before network namespace died
Yu Watanabe [Tue, 30 Jul 2024 05:35:33 +0000 (14:35 +0900)] 
nspawn: remove macvlan interfaces before network namespace died

This is similar to what we do for veth interfaces in remove_veth_links().

When a container rebooted, macvlan interfaces created by the previous
boot may still exist in the kernel, and that causes -EADDRINUSE after
reboot.

Hopefully fixes #680.

15 months agocgroup-util: Ignore kernel threads in cg_kill_items()
Daan De Meyer [Tue, 30 Jul 2024 09:53:32 +0000 (11:53 +0200)] 
cgroup-util: Ignore kernel threads in cg_kill_items()

Similar to the implementation of cgroup.kill in the kernel, let's
skip kernel threads in cg_kill_items() as trying to kill kernel
threads as an unprivileged process will fail with EPERM and doesn't
do anything when running privileged.

15 months agokernel-install: Try some more initrd variants in 90-loaderentry.install
Daan De Meyer [Mon, 29 Jul 2024 13:41:51 +0000 (15:41 +0200)] 
kernel-install: Try some more initrd variants in 90-loaderentry.install

On CentOS/Fedora, dracut is configured to write the initrd to
/boot/initramfs-$KERNEL_VERSION...img so let's check for that as well
if no initrds were supplied.

15 months agokernel-install: Only read cmdline from /proc/cmdline when not in container
Daan De Meyer [Mon, 29 Jul 2024 15:13:28 +0000 (17:13 +0200)] 
kernel-install: Only read cmdline from /proc/cmdline when not in container

If we're running from within a container, we're very likely not going
to want to use the kernel command line from /proc/cmdline, so let's add
a check to see if we're running from a container to decide whether we'll
use the kernel command line from /proc/cmdline.

15 months agoMerge pull request #33857 from DaanDeMeyer/mkosi
Daan De Meyer [Mon, 29 Jul 2024 13:40:48 +0000 (15:40 +0200)] 
Merge pull request #33857 from DaanDeMeyer/mkosi

Two small improvements

15 months agodocs: Simplify hacking instructions a bit 33857/head
Daan De Meyer [Mon, 29 Jul 2024 11:42:28 +0000 (13:42 +0200)] 
docs: Simplify hacking instructions a bit

We enable RuntimeBuildSources=yes by default so let's drop it from
the documentation.

15 months agotest: Don't mount build sources into image when running non-interactively
Daan De Meyer [Mon, 29 Jul 2024 11:40:42 +0000 (13:40 +0200)] 
test: Don't mount build sources into image when running non-interactively

15 months agopo: Translated using Weblate (Slovenian)
Martin Srebotnjak [Mon, 29 Jul 2024 08:38:40 +0000 (10:38 +0200)] 
po: Translated using Weblate (Slovenian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Martin Srebotnjak <miles@filmsi.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sl/
Translation: systemd/main

15 months agoMerge pull request #33853 from NickCao/l3mdev
Luca Boccassi [Mon, 29 Jul 2024 09:15:52 +0000 (10:15 +0100)] 
Merge pull request #33853 from NickCao/l3mdev

network: Fixup Table when L3MasterDevice is set on routing policy rule

15 months agonetwork: Fixup Table when L3MasterDevice is set on routing policy rule 33853/head
Nick Cao [Sun, 28 Jul 2024 14:07:19 +0000 (10:07 -0400)] 
network: Fixup Table when L3MasterDevice is set on routing policy rule

15 months agoman: network: move note about L3MasterDevice to the correct section
Nick Cao [Sun, 28 Jul 2024 17:50:30 +0000 (13:50 -0400)] 
man: network: move note about L3MasterDevice to the correct section

15 months agoman: clarify systemd-path variable source 32430/head
Vladimir Panteleev [Sat, 27 Jul 2024 11:49:20 +0000 (11:49 +0000)] 
man: clarify systemd-path variable source

15 months agoman: improve ManagerEnvironment documentation
Vladimir Panteleev [Sat, 27 Jul 2024 11:43:47 +0000 (11:43 +0000)] 
man: improve ManagerEnvironment documentation

- Improve wording for explanation when these variables are inherited

- Clarify that these variables are not placed in the process environment block,
  so /proc/PID/environ cannot be used as a debugging tool

15 months agoMerge pull request #33848 from weblate/weblate-systemd-main
Luca Boccassi [Sat, 27 Jul 2024 10:27:29 +0000 (11:27 +0100)] 
Merge pull request #33848 from weblate/weblate-systemd-main

Translations update from Fedora Weblate

15 months agopo: Translated using Weblate (Slovenian) 33848/head
Weblate Translation Memory [Fri, 26 Jul 2024 14:38:49 +0000 (16:38 +0200)] 
po: Translated using Weblate (Slovenian)

Currently translated at 100.0% (233 of 233 strings)

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

15 months agopo: Translated using Weblate (Slovenian)
Martin Srebotnjak [Fri, 26 Jul 2024 14:38:49 +0000 (16:38 +0200)] 
po: Translated using Weblate (Slovenian)

Currently translated at 100.0% (233 of 233 strings)

Co-authored-by: Martin Srebotnjak <miles@filmsi.net>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/sl/
Translation: systemd/main

15 months agokernel-install: remove depmod generated file modules.weakdep
Jose Ignacio Tornos Martinez [Fri, 26 Jul 2024 08:28:21 +0000 (10:28 +0200)] 
kernel-install: remove depmod generated file modules.weakdep

The new file, modules.weakdep, generated by depmod to get the weak
dpendencies information can be present
(https://github.com/kmod-project/kmod/commit/05828b4a6e9327a63ef94df544a042b5e9ce4fe7),
so remove it like the other similar files.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
15 months agoMerge pull request #27855 from Werkov/test-delegate-useraddfixup
Luca Boccassi [Fri, 26 Jul 2024 13:01:38 +0000 (14:01 +0100)] 
Merge pull request #27855 from Werkov/test-delegate-useraddfixup

Delegate/cgroup test refactor

15 months agoMerge pull request #30307 from bluca/enforce_inhibitors
Zbigniew Jędrzejewski-Szmek [Fri, 26 Jul 2024 11:52:34 +0000 (13:52 +0200)] 
Merge pull request #30307 from bluca/enforce_inhibitors

logind: always check for inhibitor locks

15 months agoresolved: Don't retry queries that indicate net error
Ronan Pigott [Thu, 25 Jul 2024 19:48:03 +0000 (12:48 -0700)] 
resolved: Don't retry queries that indicate net error

This probably rarely helped anyway, but it also in some cases interferes
with auxiliary dnssec queries where the authoritative nameserver does
not support EDNS0/DNSSEC.

Fixes: ac6844460ca1 ("resolved: support RFC 8914 EDE error codes")
15 months agoMerge pull request #33842 from DaanDeMeyer/test
Luca Boccassi [Fri, 26 Jul 2024 09:04:20 +0000 (10:04 +0100)] 
Merge pull request #33842 from DaanDeMeyer/test

Two fixes

15 months agotest: Fail cgroup delegation test when user cannot be created 27855/head
Michal Koutný [Fri, 26 Jul 2024 08:44:10 +0000 (10:44 +0200)] 
test: Fail cgroup delegation test when user cannot be created

It means: a) user cannot be created, something's wrong in the
test environment -> fail the test; b) user already exists, we shall not
continue and delete (foreign) user.

15 months agoresize-fs: Put minimal ext4 size in the same ballpark as the other filesystems 33842/head
Daan De Meyer [Thu, 25 Jul 2024 11:22:42 +0000 (13:22 +0200)] 
resize-fs: Put minimal ext4 size in the same ballpark as the other filesystems

TEST-46-HOMED fails on ext4 because the filesystem is deemed to small
for activation by cryptsetup. Let's bump the minimal filesystem size for
ext4 a bit to be in the same ballpark as ext4 and btrfs to avoid weird
errors due to impossibly small filesystems.

Also use U64_MB while we're touching this.

15 months agotest: Reorganize testcase of cgroup delegation
Michal Koutný [Thu, 31 Mar 2022 16:25:36 +0000 (18:25 +0200)] 
test: Reorganize testcase of cgroup delegation

There are multiple subtests, just move them around into functions
(leveraging the testcase_* convention) to make space for new related
subtests.

15 months agoMerge pull request #33825 from DaanDeMeyer/chattr
Luca Boccassi [Thu, 25 Jul 2024 13:11:11 +0000 (14:11 +0100)] 
Merge pull request #33825 from DaanDeMeyer/chattr

repart: Create disk image file with copy-on-write disabled on btrfs

15 months agoshell completion: add support for sd-analyze capability --mask
Luca Boccassi [Thu, 25 Jul 2024 11:05:53 +0000 (12:05 +0100)] 
shell completion: add support for sd-analyze capability --mask

Follow-up for 3e7a029c2856e7814b930443cc2d4fb089377592

15 months agoMerge pull request #33840 from bluca/test_locale_dbus
Luca Boccassi [Thu, 25 Jul 2024 12:18:53 +0000 (13:18 +0100)] 
Merge pull request #33840 from bluca/test_locale_dbus

test: fix D-Bus policy override for TEST-73-LOCALE

15 months agoNEWS: mention logind inhibitors change 30307/head
Luca Boccassi [Wed, 7 Feb 2024 23:27:31 +0000 (23:27 +0000)] 
NEWS: mention logind inhibitors change

15 months agologind: always check for inhibitor locks
Luca Boccassi [Sat, 2 Dec 2023 20:11:57 +0000 (20:11 +0000)] 
logind: always check for inhibitor locks

Currently inhibitors are bypassed unless an explicit request is made to
check for them, or even in that case when the requestor is root or the
same uid as the holder of the lock.

But in many cases this makes it impractical to rely on inhibitor locks.
For example, in Debian there are several convoluted and archaic
workarounds that divert systemctl/reboot to some hacky custom scripts
to try and enforce blocking accidental reboots, when it's not expected
that the requestor will remember to specify the command line option
to enable checking for active inhibitor locks.

Also in many cases one wants to ensure that locks taken by a user are
respected by actions initiated by that same user.

Change logind so that inhibitors checks are not skipped in these
cases, and systemctl so that locks are checked in order to show a
friendly error message rather than "permission denied".

Add new block-weak and delay-weak modes that keep the previous
behaviour unchanged.

15 months agoTEST-54-CREDS: Specify SMBIOS creds via corresponding mkosi option
Daan De Meyer [Thu, 25 Jul 2024 11:08:48 +0000 (13:08 +0200)] 
TEST-54-CREDS: Specify SMBIOS creds via corresponding mkosi option

This allows mkosi to combine fstab.extra with its own fstab.extra so
that it doesn't override the one we pass for the test.

15 months agosd-event: do not assert on invalid signal
David Tardon [Thu, 25 Jul 2024 08:06:34 +0000 (10:06 +0200)] 
sd-event: do not assert on invalid signal

The signalfd_siginfo struct is received from outside via a FD, hence
assert() is not appropriate way to check it. Just do a normal runtime
check.

15 months agologind-dbus: check auth. for all inhibitor operations
David Tardon [Thu, 25 Jul 2024 07:47:56 +0000 (09:47 +0200)] 
logind-dbus: check auth. for all inhibitor operations

Fixes #33834

15 months agodocs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus
Jeffrey Bosboom [Thu, 25 Jul 2024 01:14:24 +0000 (18:14 -0700)] 
docs/CONTROL_GROUP_INTERFACE.md: document accounting information available via D-Bus

15 months agoMerge pull request #33727 from intelfx/work/analyze-capability-masks
Luca Boccassi [Thu, 25 Jul 2024 10:08:21 +0000 (11:08 +0100)] 
Merge pull request #33727 from intelfx/work/analyze-capability-masks

analyze: capability: add support for decoding capability masks

15 months agobasic/log: do not treat all negative errnos as synthetic
Mike Yuan [Wed, 24 Jul 2024 14:28:48 +0000 (16:28 +0200)] 
basic/log: do not treat all negative errnos as synthetic

Currently, IS_SYNTHETIC_ERRNO() evaluates to true for all negative errnos,
because of the two's-complement negative value representation.
Subsequently, ERRNO= is not logged for most of our own code.
Let's fix this, by formatting all synthetic errnos as positive.
Then, treat all negative values as non-synthetic.

While at it, mark the evaluation order explicitly, and remove
unneeded comment.

Fixes #33800

15 months agotree-wide: Don't explicity disable copy-on-write when copying images 33825/head
Daan De Meyer [Wed, 24 Jul 2024 13:04:43 +0000 (15:04 +0200)] 
tree-wide: Don't explicity disable copy-on-write when copying images

Since the copy helpers now copy file attributes as well, let's not
explicitly disable copy-on-write anymore when we copy an image. If
the source already has copy-on-write disabled, the copy will have it
disabled as well. Otherwise, the copy will also have copy-on-write
enabled.

This makes sure that reflinks always work as reflink is only supported
if both source and target are copy-on-write or both source and target
are not copy-on-write.

15 months agocopy: Copy file attributes as well
Daan De Meyer [Wed, 24 Jul 2024 12:56:11 +0000 (14:56 +0200)] 
copy: Copy file attributes as well

Let's make sure we copy all file attributes that can be copied as
well.

15 months agomkosi: update debian commit reference 33840/head
Luca Boccassi [Thu, 25 Jul 2024 09:46:56 +0000 (10:46 +0100)] 
mkosi: update debian commit reference

7eebe8c0b1 autopkgtest: allow localectl in localed tests
c08a88ffbb Update changelog for 256.4-1 release
03814c87fe Fix D-Bus policy for locale1 blocking
16f6130038 Drop last patch, all merged upstream
fe6956e934 Install varlinkctl zsh completion file
9bc2a52832 Update upstream source from tag 'upstream/256.4'
8574241978 New upstream version 256.4

15 months agotest: fix D-Bus policy override for TEST-73-LOCALE
Luca Boccassi [Thu, 25 Jul 2024 09:43:48 +0000 (10:43 +0100)] 
test: fix D-Bus policy override for TEST-73-LOCALE

We don't need to allow non-root, and the policy needs to specify destination
and interface too, to narrow it down

Follow-up for 7b5c38a91def6cf236605010a0a93a1cd4c137e9

15 months agoMake read_attr_path() more generic
Daan De Meyer [Wed, 24 Jul 2024 12:54:06 +0000 (14:54 +0200)] 
Make read_attr_path() more generic

Let's make this an openat() like function so it can be used in more
scenarios.

15 months agorepart: Create disk image file with copy-on-write disabled on btrfs
Daan De Meyer [Tue, 23 Jul 2024 20:44:03 +0000 (22:44 +0200)] 
repart: Create disk image file with copy-on-write disabled on btrfs

COW on btrfs generally does not play well lots of random writes so
let's make the disk images generated by repart NOCOW by default on
btrfs like we do elsewhere across the codebase.

15 months agorepart: Make partition files NOCOW if the disk image is NOCOW
Daan De Meyer [Tue, 23 Jul 2024 19:43:13 +0000 (21:43 +0200)] 
repart: Make partition files NOCOW if the disk image is NOCOW

On btrfs, reflinks into a disk image that has copy-on-write disabled
only work if the source has copy-on-write disabled as well so let's
make sure that's the case if the disk image has copy-on-write disabled.

15 months agofs-util: Add XO_NOCOW flag
Daan De Meyer [Tue, 23 Jul 2024 19:37:11 +0000 (21:37 +0200)] 
fs-util: Add XO_NOCOW flag

Let's add a flag for xopenat() that immediately makes a file NOCOW
after opening it if it's supported.

15 months agofs-util: Clean up properly in xopenat_full() on labelling error
Daan De Meyer [Tue, 23 Jul 2024 19:35:08 +0000 (21:35 +0200)] 
fs-util: Clean up properly in xopenat_full() on labelling error

If we fail to relabel the file, we should unlink the file or directory
again, so let's make sure we do that.

15 months agofs-util: Handle dangling symlinks in openat_report_new()
Daan De Meyer [Wed, 24 Jul 2024 08:41:24 +0000 (10:41 +0200)] 
fs-util: Handle dangling symlinks in openat_report_new()

openat() will always resolve symlinks, except if O_NOFOLLOW is passed
or O_CREAT|O_EXCL is passed. This means that if a dangling symlink is
passed to openat_report_new(), the first call to openat() will always
fail with ENOENT and the second call to openat() will always fail with
EEXIST.

Let's catch this case explicitly and fallback to creating the file with
just O_CREAT and assume we're the ones that created the file. We can't
resolve the symlink with chase() because this function is itself called
by chase() so we could end up in weird recursive calls if we'd try to do
so.

15 months agotest-fs-util: Modernize openat_report_new() test
Daan De Meyer [Wed, 24 Jul 2024 08:50:38 +0000 (10:50 +0200)] 
test-fs-util: Modernize openat_report_new() test

15 months agotest-id128: Use new assertion macros
Daan De Meyer [Wed, 24 Jul 2024 07:56:25 +0000 (09:56 +0200)] 
test-id128: Use new assertion macros

15 months agotest: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128()
Daan De Meyer [Wed, 24 Jul 2024 07:56:01 +0000 (09:56 +0200)] 
test: Add ASSERT_EQ_ID128() and ASSERT_NE_ID128()

15 months agotest: Add ASSERT_FAIL()
Daan De Meyer [Wed, 24 Jul 2024 07:55:21 +0000 (09:55 +0200)] 
test: Add ASSERT_FAIL()

15 months agomkosi: Update to latest
Daan De Meyer [Wed, 24 Jul 2024 11:27:46 +0000 (13:27 +0200)] 
mkosi: Update to latest

Includes the required fix to make mkosi copy NOCOW disk images properly.

15 months agoanalyze: capability: add support for decoding capability masks 33727/head
Ivan Shapovalov [Mon, 15 Jul 2024 09:47:25 +0000 (11:47 +0200)] 
analyze: capability: add support for decoding capability masks

This adds support in `systemd-analyze capability` for decoding
capability masks (sets), e.g.:

```console
$ systemd-analyze capability --mask 0000000000003c00
NAME                 NUMBER
cap_net_bind_service     10
cap_net_broadcast        11
cap_net_admin            12
cap_net_raw              13
```

This is intended as a convenience tool for pretty-printing capability
values as found in e.g. `/proc/$PID/status`.

15 months agomkosi: update debian commit reference
Luca Boccassi [Wed, 24 Jul 2024 09:16:06 +0000 (10:16 +0100)] 
mkosi: update debian commit reference

c7138e0b87 Configure default DNS servers for upstream CI builds
bc5d1afe1e Drop out-of-tree localed patch and use D-Bus policy instead
b5f8ababde autopkgtest: set Release= in mkosi.local.conf to distinguish testing vs unstable
323afafd80 autopkgtest: add allow-stderr to timedated test
0291f361e3 Install valrinkctl zsh completion file
f40b9eba02 d/t/control: add Depends: lib{systemd,udev}-dev for upstream
3def595de3 d/t/upstream: ensure correct ubuntu codename is used
531bb6817e d/t/boot-and-services: fix a couple python sytax warnings
963ac13b7d d/t/boot-and-services: skip test_tmp_cleanup if tmp.mount is overridden

15 months agohwdb: add axis range corrections for the Lenovo Thinkpad E16
MkKvcs [Wed, 24 Jul 2024 01:12:05 +0000 (03:12 +0200)] 
hwdb: add axis range corrections for the Lenovo Thinkpad E16

15 months agoMerge pull request #33823 from YHNdnzj/varlink-deserialize-again
Luca Boccassi [Wed, 24 Jul 2024 07:23:36 +0000 (08:23 +0100)] 
Merge pull request #33823 from YHNdnzj/varlink-deserialize-again

core: reliably check if varlink socket has been deserialized; switch varlink server to pidref

15 months agoadd udev rules for trezor hw wallet devices
vdovhanych [Mon, 22 Jul 2024 20:57:25 +0000 (22:57 +0200)] 
add udev rules for trezor hw wallet devices

15 months agoresolved: report svc params as a json object
Ronan Pigott [Wed, 17 Jul 2024 23:30:19 +0000 (16:30 -0700)] 
resolved: report svc params as a json object

This representation is significantly more useful. The previous array
format omitted the svc param key, which is not very useful.