]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
11 months agoMerge pull request #27941 from cvlc12/early_cpio
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jun 2023 16:49:31 +0000 (18:49 +0200)] 
Merge pull request #27941 from cvlc12/early_cpio

Define 'microcode' file type for the kernel-install staging area.

11 months agoRevert "core/service: when resetting PID also reset known flag"
msizanoen [Mon, 12 Jun 2023 03:30:12 +0000 (10:30 +0700)] 
Revert "core/service: when resetting PID also reset known flag"

This reverts commit ff32060f2ed37b68dc26256b05e2e69013b0ecfe.

This change is incorrect as we don't want to mark the PID as invalid but
only mark it as dead.

The change in question also breaks user level socket activation for
`podman.service` as the termination of the main `podman system service`
process is not properly handled, causing any application accessing the
socket to hang.

This is because the user-level `podman.service` unit also hosts two
non-main processes: `rootlessport` and `rootlessport-child` which causes
the `cgroup_good` check to still succeed.

The original submitter of this commit is recommended to find another
more correct way to fix the cgroupsv1 issue on CentOS 8.

11 months agoAdd docs, improve log comments. 27941/head
cvlc12 [Mon, 19 Jun 2023 15:31:58 +0000 (17:31 +0200)] 
Add docs, improve log comments.

11 months agoMerge pull request #28078 from keszybz/trivial-syntax-and-wording-fixes
Frantisek Sumsal [Mon, 19 Jun 2023 14:41:16 +0000 (16:41 +0200)] 
Merge pull request #28078 from keszybz/trivial-syntax-and-wording-fixes

Trivial syntax and wording fixes

11 months agoMerge pull request #28056 from dtardon/polkit-cleanup
Lennart Poettering [Mon, 19 Jun 2023 13:50:35 +0000 (15:50 +0200)] 
Merge pull request #28056 from dtardon/polkit-cleanup

Some bus-polkit cleanup

11 months agoman: place options in a some limited form of subsections
Lennart Poettering [Mon, 19 Jun 2023 11:00:29 +0000 (13:00 +0200)] 
man: place options in a some limited form of subsections

Let's visually separate the options associated with cpu, io, memory, …
in subsections

This patch tries to be minimal. It just adds the section titles, and
does minimal reordering to make sure the options on the same kind of
resource are placed close to each other.

11 months agomachinectl: fix message 28078/head
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jun 2023 11:35:22 +0000 (13:35 +0200)] 
machinectl: fix message

bus_wait_for_jobs_new() can fail for various reasons.

11 months agoshared: improve messages about switch root operations
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jun 2023 11:35:00 +0000 (13:35 +0200)] 
shared: improve messages about switch root operations

"change" is not clear without context.

11 months agoman/systemd-nspawn: fix indentation and parenthesis location
Zbigniew Jędrzejewski-Szmek [Fri, 16 Jun 2023 07:43:46 +0000 (09:43 +0200)] 
man/systemd-nspawn: fix indentation and parenthesis location

11 months agodocs/CREDENTIALS: fix confusion of i.e. and e.g.
Zbigniew Jędrzejewski-Szmek [Thu, 15 Jun 2023 09:03:39 +0000 (11:03 +0200)] 
docs/CREDENTIALS: fix confusion of i.e. and e.g.

11 months agoman: missing/misplaced periods
Zbigniew Jędrzejewski-Szmek [Mon, 19 Jun 2023 11:35:45 +0000 (13:35 +0200)] 
man: missing/misplaced periods

11 months agoResource control manpage fixup (#28046)
Sam Morris [Mon, 19 Jun 2023 11:30:43 +0000 (12:30 +0100)] 
Resource control manpage fixup (#28046)

The order of the description of each item should match the order that they are declared. Un-document effect of deprecated non-unified CGroup hierarchy on
DefaultCPUAccounting=. Mention that the default value for DefaultCPUAccouting= is
affected by the kernel version.

11 months agoMerge pull request #28074 from mrc0mmand/journal-gatewayd-followups
Luca Boccassi [Mon, 19 Jun 2023 11:14:28 +0000 (12:14 +0100)] 
Merge pull request #28074 from mrc0mmand/journal-gatewayd-followups

A couple of follow-ups for systemd-journal-gatewayd tests

11 months agobus-polkit: put function params to a single line 28056/head
David Tardon [Fri, 26 May 2023 13:42:02 +0000 (15:42 +0200)] 
bus-polkit: put function params to a single line

11 months agobus-polkit: drop unnecessary else
David Tardon [Mon, 19 Jun 2023 10:35:05 +0000 (12:35 +0200)] 
bus-polkit: drop unnecessary else

11 months agobus-polkit: merge variable declarations
David Tardon [Mon, 19 Jun 2023 10:34:27 +0000 (12:34 +0200)] 
bus-polkit: merge variable declarations

11 months agobus-polkit: decrease indentation
David Tardon [Fri, 26 May 2023 13:15:34 +0000 (15:15 +0200)] 
bus-polkit: decrease indentation

11 months agobus-polkit: extract creation of polkit call to a function
David Tardon [Fri, 26 May 2023 13:07:10 +0000 (15:07 +0200)] 
bus-polkit: extract creation of polkit call to a function

11 months agobus-polkit: move verification to a separate function
David Tardon [Fri, 3 Feb 2023 13:05:46 +0000 (14:05 +0100)] 
bus-polkit: move verification to a separate function

11 months agohomework: resize to maximum disk space if disk size is not specified
Gibeom Gwon [Wed, 19 Oct 2022 09:12:29 +0000 (18:12 +0900)] 
homework: resize to maximum disk space if disk size is not specified

If the backing storage is LUKS2 on a block device, auto resize mode
is enabled, and disk size is not specified, resize the partition to
the maximum expandable size.

Fixes: #22255, #23967
11 months agoupdate TODO
Lennart Poettering [Mon, 19 Jun 2023 08:36:42 +0000 (10:36 +0200)] 
update TODO

11 months agomkosi: Update to latest
Daan De Meyer [Thu, 15 Jun 2023 15:31:23 +0000 (17:31 +0200)] 
mkosi: Update to latest

We now run repart before starting systemd-nspawn to make sure that
the root partition is also generated when we boot the image in a
container instead of a VM.

To make sure we start from scratch for both the container boot and
the VM boot, we also enable Ephemeral to make sure all changes to
the image are ephemeral.

11 months agotest: wrap curl when running with ASan 28074/head
Frantisek Sumsal [Mon, 19 Jun 2023 07:21:00 +0000 (09:21 +0200)] 
test: wrap curl when running with ASan

Necessary (unfortunately) for curl on C8S.

11 months agojournal-gatewayd: handle SIGTERM
Frantisek Sumsal [Sun, 18 Jun 2023 21:26:01 +0000 (23:26 +0200)] 
journal-gatewayd: handle SIGTERM

To allow gatewayd to exit cleanly.

11 months agocore/dbus-manager: also show DefaultIOAccounting and DefaultIPAccounting
licunlong [Mon, 19 Jun 2023 02:24:13 +0000 (10:24 +0800)] 
core/dbus-manager: also show DefaultIOAccounting and DefaultIPAccounting

fix: https://github.com/systemd/systemd/issues/28045

11 months agotest: extend the DynamicUser=yes coverage workaround to a couple more services
Frantisek Sumsal [Sun, 18 Jun 2023 21:08:24 +0000 (23:08 +0200)] 
test: extend the DynamicUser=yes coverage workaround to a couple more services

11 months agoDefine 'microcode' type of initrd for the kernel-install staging area.
cvlc12 [Tue, 6 Jun 2023 15:14:57 +0000 (17:14 +0200)] 
Define 'microcode' type of initrd for the kernel-install staging area.

This allows microcode to be referenced first for UKIs and loader entries.

11 months agoMerge pull request #28069 from medhefgo/boot-dp
Luca Boccassi [Sun, 18 Jun 2023 14:11:49 +0000 (15:11 +0100)] 
Merge pull request #28069 from medhefgo/boot-dp

boot: device_path_to_str improvements

11 months agojournal: avoid infinite recursion when closing bad journal FD
Luca Boccassi [Fri, 16 Jun 2023 21:31:04 +0000 (22:31 +0100)] 
journal: avoid infinite recursion when closing bad journal FD

When trying to log, if we fail we try to close the journal FD. If
it is bad, safe_close() will fail and assert, which will try to log,
which will fail, which will try to close the journal FD...
Infinite recursion looks very pretty live in gdb, but let's avoid
that by immediately invalidating the journal FD before closing it.

11 months agoboot: Improve device_path_to_str_internal() 28069/head
Jan Janssen [Sun, 18 Jun 2023 08:54:20 +0000 (10:54 +0200)] 
boot: Improve device_path_to_str_internal()

The UEFI spec has a generic `Path` node representation that can be used
for device path nodes that are unknown. So we can use that instead of
giving up when we see a node other than FilePath.

This also simplifies the FilePath case by just using xasprintf(). The
code is really just a fallback for silly firmware that does not
implement EFI_DEVICE_PATH_TO_TEXT_PROTOCOL (looking at you, Apple).

The correctness of this was tested by round-tripping it through
EFI_DEVICE_PATH_FROM_TEXT_PROTOCOL, which yielded an identical device
compared to our input path.

11 months agoboot: Split log_hexdump()
Jan Janssen [Sun, 18 Jun 2023 08:44:39 +0000 (10:44 +0200)] 
boot: Split log_hexdump()

11 months agoboot: Move custom device path string creating into its own function
Jan Janssen [Sun, 18 Jun 2023 07:42:22 +0000 (09:42 +0200)] 
boot: Move custom device path string creating into its own function

11 months agoMerge pull request #28060 from mrc0mmand/remote-journal-tests
Luca Boccassi [Sat, 17 Jun 2023 10:34:50 +0000 (11:34 +0100)] 
Merge pull request #28060 from mrc0mmand/remote-journal-tests

test: add a couple of tests for systemd-journal-gatewayd

11 months agoMerge pull request #28063 from bluca/test_oomd_fixlets
Yu Watanabe [Sat, 17 Jun 2023 05:37:53 +0000 (14:37 +0900)] 
Merge pull request #28063 from bluca/test_oomd_fixlets

Readability fixes for TEST-55-OOMD

11 months agoTEST-55-OOMD: improve ephemeral configuration readability 28063/head
Luca Boccassi [Fri, 16 Jun 2023 23:06:38 +0000 (00:06 +0100)] 
TEST-55-OOMD: improve ephemeral configuration readability

11 months agoTEST-55-OOMD: use /run/ for configuration instead of /etc/
Luca Boccassi [Fri, 16 Jun 2023 23:01:24 +0000 (00:01 +0100)] 
TEST-55-OOMD: use /run/ for configuration instead of /etc/

Make sure configuration is ephemeral if the image is reused

11 months agosocket-activate: make a copy of the command name and arguments 28060/head
Frantisek Sumsal [Fri, 16 Jun 2023 17:05:57 +0000 (19:05 +0200)] 
socket-activate: make a copy of the command name and arguments

When we call safe_fork() with the first argument set (process name), we
call rename_process() that zeroes out saved argv (that was saved by
save_argc_argv() in the main func defined by DEFINE_MAIN_FUNC()). In this
case this means that with --accept both the target executable name and
its arguments will be empty strings:

```
$ systemd-socket-activate --accept --listen 1111 cat &
Listening on [::]:1111 as 3.
$ curl localhost:1111
Communication attempt on fd 3.
Connection from 127.0.0.1:52948 to [::ffff:127.0.0.1]:1111
Spawned cat (cat) as PID 10576.
Execing  ()
Failed to execp  (): No such file or directory
Child 10576 died with code 1
curl: (56) Recv failure: Connection reset by peer
```

Let's make a copy of the necessary arguments beforehand and use it
instead to fix this.

11 months agotest: add a couple of tests for systemd-journal-gatewayd
Frantisek Sumsal [Fri, 16 Jun 2023 16:50:08 +0000 (18:50 +0200)] 
test: add a couple of tests for systemd-journal-gatewayd

11 months agoresolved: Initialize until_valid while storing negative/NXDOMAIN response in the...
Kiran Vemula [Fri, 16 Jun 2023 12:04:37 +0000 (17:34 +0530)] 
resolved: Initialize until_valid while storing negative/NXDOMAIN  response in the cache

Initialize until_valid is properly for negative response, the cached negative responses can be used to answer the queries before contacting upstream server.

11 months agoMerge pull request #28049 from bluca/portablectl_flags
Luca Boccassi [Fri, 16 Jun 2023 16:44:34 +0000 (17:44 +0100)] 
Merge pull request #28049 from bluca/portablectl_flags

portable: fix silly typo in D-Bus interface name, use only new(er) methods from portablectl

11 months agojournal-gatewayd: make MHD_OPTION_EXTERNAL_LOGGER the first option
Frantisek Sumsal [Fri, 16 Jun 2023 15:03:27 +0000 (17:03 +0200)] 
journal-gatewayd: make MHD_OPTION_EXTERNAL_LOGGER the first option

To get rid of the warning on gatewayd startup:
    microhttpd: MHD_OPTION_EXTERNAL_LOGGER is not the first option
    specified for the daemon. Some messages may be printed by the
    standard MHD logger.

11 months agoportablectl: fix using --force when no --extension is passed 28049/head
Luca Boccassi [Fri, 16 Jun 2023 11:31:37 +0000 (12:31 +0100)] 
portablectl: fix using --force when no --extension is passed

The 'force' flag applies whether or not extensions are present

11 months agoportable: fix silly typo in D-Bus interface name
Luca Boccassi [Thu, 15 Jun 2023 17:54:56 +0000 (18:54 +0100)] 
portable: fix silly typo in D-Bus interface name

D'oh. Nobody noticed in 3 years, I guess nobody calls these directly
and instead the manager's methods are used. Still we'll have to keep
this around, so just hide it.

11 months agoresolved: added serve stale feature implementation of RFC 8767
Kiran Vemula [Thu, 8 Jun 2023 13:12:11 +0000 (18:42 +0530)] 
resolved: added serve stale feature implementation of RFC 8767

serve stale feature to keep the DNS resource records beyond TTL to return them as stale records in case of upstream server is not reachable or returns negative response.
SD_RESOLVED_NO_STALE flag has been added to disable serving stale records via dbus.
added serve stale test cases to TEST-75-RESOLVED
Fixes: #21815
11 months agoMerge pull request #23391 from yuwata/meson-bump-required-version
Luca Boccassi [Fri, 16 Jun 2023 09:13:44 +0000 (10:13 +0100)] 
Merge pull request #23391 from yuwata/meson-bump-required-version

meson: bump required version

11 months agobus-polkit: return NULL from _free function
David Tardon [Fri, 3 Feb 2023 12:50:11 +0000 (13:50 +0100)] 
bus-polkit: return NULL from _free function

11 months agobus-polkit: add an assert
David Tardon [Fri, 3 Feb 2023 12:05:38 +0000 (13:05 +0100)] 
bus-polkit: add an assert

11 months agotest: clean up the new test case a bit
Frantisek Sumsal [Fri, 16 Jun 2023 07:56:32 +0000 (09:56 +0200)] 
test: clean up the new test case a bit

Follow-up to 61cecfa0d8.

11 months agoMerge pull request #27927 from Geass-LL/main
Lennart Poettering [Fri, 16 Jun 2023 07:38:53 +0000 (09:38 +0200)] 
Merge pull request #27927 from Geass-LL/main

core/unit: increase the GetNameOwner timeout to 90s

11 months agojournalctl: add --truncate-newline option
zhmylove [Tue, 30 Aug 2022 15:50:19 +0000 (18:50 +0300)] 
journalctl: add --truncate-newline option

11 months agonetworkd-test.py: disable global DNS= setting 23391/head
Yu Watanabe [Fri, 16 Jun 2023 00:29:46 +0000 (09:29 +0900)] 
networkd-test.py: disable global DNS= setting

Otherwise, queries may be passed to unexpected DNS servers.

11 months agonetworkd-test.py: do not query IPv6 address
Yu Watanabe [Thu, 15 Jun 2023 20:55:58 +0000 (05:55 +0900)] 
networkd-test.py: do not query IPv6 address

From changelog of dnsmasq v2.87:
====
Note in manpage the change in behaviour of -address. This behaviour
actually changed in v2.86, but was undocumented there. From 2.86 on,
(eg) --address=/example.com/1.2.3.4 ONLY applies to A queries. All other
types of query will be sent upstream. Pre 2.86, that would catch the
whole example.com domain and queries for other types would get
a local NODATA answer. The pre-2.86 behaviour is still available,
by configuring --address=/example.com/1.2.3.4 --local=/example.com/
====

11 months agonetworkd-test.py: replace deprecated option IPv6AcceptRouterAdvertisements=
Yu Watanabe [Thu, 15 Jun 2023 21:54:04 +0000 (06:54 +0900)] 
networkd-test.py: replace deprecated option IPv6AcceptRouterAdvertisements=

Also, use 'yes' or 'no' for boolean options.

11 months agonetworkd-test.py: show more debugging logs on failure
Yu Watanabe [Thu, 15 Jun 2023 19:56:18 +0000 (04:56 +0900)] 
networkd-test.py: show more debugging logs on failure

11 months agoci: drop the "find" kludge
Evgeny Vereshchagin [Sat, 30 Apr 2022 03:43:29 +0000 (03:43 +0000)] 
ci: drop the "find" kludge

meson no longer complains about install_tag

11 months agomeson: bump required version to 0.60.0
Yu Watanabe [Sun, 15 May 2022 19:08:21 +0000 (04:08 +0900)] 
meson: bump required version to 0.60.0

To suppress warning about install_tag argument.

11 months agomeson: bump required version to 0.59.0
Yu Watanabe [Sun, 15 May 2022 18:53:01 +0000 (03:53 +0900)] 
meson: bump required version to 0.59.0

fs.stemp() and fs.name() can take File object since 0.59.0.

11 months agoci: bump debian release bullseye -> bookworm
Yu Watanabe [Thu, 15 Jun 2023 12:34:17 +0000 (21:34 +0900)] 
ci: bump debian release bullseye -> bookworm

Preparation for bumping meson requirement higher than 0.56.2.

11 months agomkosi: install HyperScale repository for CentOS 8
Yu Watanabe [Thu, 15 Jun 2023 13:03:52 +0000 (22:03 +0900)] 
mkosi: install HyperScale repository for CentOS 8

Preparation for bumping meson requirement higher than 0.56.2.

11 months agomeson: drop non-existent test directories
Yu Watanabe [Thu, 15 Jun 2023 05:36:42 +0000 (14:36 +0900)] 
meson: drop non-existent test directories

11 months agomeson: drop redundant spaces
Yu Watanabe [Sun, 29 May 2022 20:11:31 +0000 (05:11 +0900)] 
meson: drop redundant spaces

11 months agocore/unit: increase the NameOwnerChanged/GetNameOwner timeout to the unit's start... 27927/head
licunlong [Wed, 24 May 2023 03:45:31 +0000 (11:45 +0800)] 
core/unit: increase the NameOwnerChanged/GetNameOwner timeout to the unit's start timeout

When dbus is overloaded, these messages are easily timedout,
systemd may kill dbus-type service by mistake. This PR
mitigates this problem by increasing the timeout to the
unit's start timeout.

11 months agocore/unit: add get_timeout_start_usec in UnitVTable and define it for service
licunlong [Thu, 15 Jun 2023 02:47:32 +0000 (10:47 +0800)] 
core/unit: add get_timeout_start_usec in UnitVTable and define it for service

11 months agoMerge pull request #28053 from mrc0mmand/assorted-fixes
Luca Boccassi [Fri, 16 Jun 2023 00:21:22 +0000 (01:21 +0100)] 
Merge pull request #28053 from mrc0mmand/assorted-fixes

A bunch of typo fixes and code cleanups

11 months agofind-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix
наб [Thu, 15 Jun 2023 13:04:32 +0000 (15:04 +0200)] 
find-esp: fix XBOOTLDR stx_dev_major=0 and not btrfs fix

The original commit is fully correct in its analysis, description, and
mechanics, but the patch changes an identical condition around line 500
(find_esp_and_warn()), instead of line 800 (find_xbootldr_and_warn()).

The internal patch I distributed to testers was correct (L800), and
neither the reviewers, nor me, caught that I wrote the wrong line for
upstream submission. I've re-checked that this patch applied to
systemd 252.11-1 fixes the issue.

Keep the -ENOTTY condition for find_esp_and_warn(), since the conditions
are clearly supposed to be the same and similar semantics apply.

Fixes: commit ed89819f8fd7bfe99cd652082076e85e1417e4e9 ("find-esp: don't
 silently error bootctl install if presumed XBOOTLDR part is
 stx_dev_major=0 but not btrfs")

11 months agocore: fix post-fork memory leak
Luca Boccassi [Thu, 15 Jun 2023 18:20:05 +0000 (19:20 +0100)] 
core: fix post-fork memory leak

Doesn't matter really, but it is caught by ASAN when things fail
and there's no execve, so fix it.

https://jenkins-systemd.apps.ocp.cloud.ci.centos.org/job/upstream-vagrant-archlinux-sanitizers/3245/console

11 months agoudev: use timestamp_is_set() in one more place 28053/head
Frantisek Sumsal [Thu, 15 Jun 2023 18:49:24 +0000 (20:49 +0200)] 
udev: use timestamp_is_set() in one more place

11 months agoaudit-util,varlink: use IOVEC_MAKE() in a couple more places
Frantisek Sumsal [Thu, 15 Jun 2023 18:45:32 +0000 (20:45 +0200)] 
audit-util,varlink: use IOVEC_MAKE() in a couple more places

11 months agotree-wide: fix a couple of typos
Frantisek Sumsal [Thu, 15 Jun 2023 18:37:55 +0000 (20:37 +0200)] 
tree-wide: fix a couple of typos

As reported by Fossies.org.

11 months agoUpdate badge on README to refer new scorecard viewer (#28050)
Joyce [Thu, 15 Jun 2023 18:24:32 +0000 (15:24 -0300)] 
Update badge on README to refer new scorecard viewer (#28050)

* Update scorecard badge on README.md

Signed-off-by: Joyce <joycebrum@google.com>
11 months agotest: set $PATH to something predictable in the ASan wrapper
Frantisek Sumsal [Thu, 15 Jun 2023 11:11:24 +0000 (13:11 +0200)] 
test: set $PATH to something predictable in the ASan wrapper

This is still necessary when running with clang's ASan, as it uses an
external binary to symbolize the stack traces.

Follow-up to ba79e8c2ccd.

11 months agosystemctl: let's emphasize a bit that halt/poweroff/reboot/shutdown are compat commands
Lennart Poettering [Thu, 15 Jun 2023 08:40:31 +0000 (10:40 +0200)] 
systemctl: let's emphasize a bit that halt/poweroff/reboot/shutdown are compat commands

Let's try to make clear that these calls really should not be extended
anymore, but remain as the compat glue they are but not more.

Anything new should really be added to systemctl poweroff/halt/reboot,
which is actually defined and owned by us.

This is added in light of a9c3cc8db02dc36d41b17d0bbf1e02500046e4ce which
really shouldn't have been added I am sure.

This adds two things: a note to the --help text that people use the
relevant systemctl commands instead (as they are a lot more powerful,
for example give you inhibitor and boot loader control, kexec, and so
on). And a note to developers that they stop adding new stuff to the
compat interfaces.

11 months agoupdate TODO
Lennart Poettering [Thu, 15 Jun 2023 11:43:54 +0000 (13:43 +0200)] 
update TODO

11 months agoexecute: fix the condition of private mounts for user namespacing
Haochen Tong [Wed, 14 Jun 2023 15:55:56 +0000 (23:55 +0800)] 
execute: fix the condition of private mounts for user namespacing

Follow-up for: 6ef721cbc7dadee4ae878ecf0076d87e57233908

11 months agosd-bus: make bus_add_match_full accept timeout
licunlong [Thu, 15 Jun 2023 08:28:28 +0000 (16:28 +0800)] 
sd-bus: make bus_add_match_full accept timeout

11 months agokernel-install: skip to read /etc/machine-info in test
Yu Watanabe [Thu, 15 Jun 2023 05:00:09 +0000 (14:00 +0900)] 
kernel-install: skip to read /etc/machine-info in test

We do not provide any way to override /etc/machine-info.
As the file is deprecated in kernel-install, let's skip to read it when
we test kernel-install.

Fixes #28011.

11 months agonetwork: make degraded-carrier bond/bridge as routable (#27776)
Henrik Holst [Thu, 15 Jun 2023 04:32:10 +0000 (06:32 +0200)] 
network: make degraded-carrier bond/bridge as routable (#27776)

This makes a bond or bridge interface in the degraded-carrier state but has a routable address
handled as routable operational state.

If the carrier is degraded but the address state is routable then the operational state should be
seen as routable and not degraded because that may be the case for bonds if some of the links are down,
but when that happens the bond as whole is still routable.

This also makes operational state to degraded if address state is degraded even if the link state is
degraded-carrier.

Fixes #22713.

11 months agoMerge pull request #28038 from mrc0mmand/cleanups
Luca Boccassi [Wed, 14 Jun 2023 22:18:04 +0000 (23:18 +0100)] 
Merge pull request #28038 from mrc0mmand/cleanups

A couple of cleanups

11 months agoSquashed commit of the following:
Joyce Brum [Wed, 14 Jun 2023 17:35:17 +0000 (14:35 -0300)] 
Squashed commit of the following:

commit ef2fc83647f69c172c11e0dea318bf6ecf79a4aa
Author: Joyce <joycebrum@google.com>
Date:   Wed Jun 14 12:18:23 2023 -0300

    Update scorecards.yml

Signed-off-by: Joyce <joycebrum@google.com>
commit c59c05c6ab156b20249e8056d8cbaafbe0c495f8
Merge: 7431a54568 f66d040d95
Author: Joyce <joycebrum@google.com>
Date:   Wed Jun 14 10:22:28 2023 -0300

    Merge branch 'main' into fix/disable-code-scanning-alerts

commit 7431a54568746a2fa4db1b23e1359984335df41e
Author: Joyce <joycebrum@google.com>
Date:   Tue Jun 13 18:15:21 2023 -0300

    Remove code scanning alerts scorecards.yml

Signed-off-by: Joyce <joycebrum@google.com>
Signed-off-by: Joyce Brum <joycebrum@google.com>
11 months agoMerge pull request #28036 from medhefgo/meson
Luca Boccassi [Wed, 14 Jun 2023 19:12:35 +0000 (20:12 +0100)] 
Merge pull request #28036 from medhefgo/meson

meson: Minor improvements

11 months agoactivate: rename to socket-activate 28038/head
Frantisek Sumsal [Wed, 14 Jun 2023 09:59:04 +0000 (11:59 +0200)] 
activate: rename to socket-activate

To make the naming consistent with the rest of the utils, i.e. binary
name minus the systemd- prefix.

11 months agotest: split TEST-04 into smaller chunks
Frantisek Sumsal [Wed, 14 Jun 2023 18:04:04 +0000 (20:04 +0200)] 
test: split TEST-04 into smaller chunks

11 months agotest: exit on first failing subtest
Frantisek Sumsal [Wed, 14 Jun 2023 18:14:25 +0000 (20:14 +0200)] 
test: exit on first failing subtest

Let's take a step back and revert back to the original behavior where we
exit on a first failing subtest. The current behavior makes fishing out the
failing test details quite unpleasant, and in certain situations the
journal may even be rotated away so we end up with no actionable logs.

11 months agomkfs-util: Hide /proc/self/mounts before running mkfs
Daan De Meyer [Wed, 14 Jun 2023 08:27:22 +0000 (10:27 +0200)] 
mkfs-util: Hide /proc/self/mounts before running mkfs

mkfs.btrfs refuses to operate on a block device with mounted
partitions, even if doing so is perfectly safe. An example when
this happens is when using systemd-repart with it's --image switch
to add a root partition to a /usr only image. As a workaround until
the issue is fixed, let's hide the information on mounted filesystems
from mkfs.btrfs so it doesn't fail and formats the new filesystem as
expected.

11 months agoresolvectl: fix double free issue
Lennart Poettering [Wed, 14 Jun 2023 12:59:54 +0000 (14:59 +0200)] 
resolvectl: fix double free issue

Follow-up for: #28012

Addresses these: https://github.com/systemd/systemd/pull/28012#issuecomment-1590889386

11 months agobootctl: warn if the ESP random seed is stored on a world-readable dir
Lennart Poettering [Tue, 13 Jun 2023 14:48:20 +0000 (16:48 +0200)] 
bootctl: warn if the ESP random seed is stored on a world-readable dir

This takes heavy inspiration from @zx2c4 (Jason A. Donenfeld)'s
PR #25531 but changes it considerably, but always going by fd instead of
paths, and only warning about the side file itself and the ESP mount
point, nothing else. This shuld be more than enough and should not be
brittle against concurrent path modifications.

Replaces: #25531

11 months agoMerge pull request #27946 from keszybz/ukify-genkey-verb
Zbigniew Jędrzejewski-Szmek [Wed, 14 Jun 2023 15:57:24 +0000 (17:57 +0200)] 
Merge pull request #27946 from keszybz/ukify-genkey-verb

Add 'genkey' verb to ukify

11 months agocoverage: fix build with g++
Frantisek Sumsal [Wed, 14 Jun 2023 08:01:15 +0000 (10:01 +0200)] 
coverage: fix build with g++

Guard the coverage-related shenanigans from g++ when building the one
C++ unit test we have, so we don't have to make it C++ compatible:

[1573/2109] Compiling C++ object test-bus-vtable-cc.p/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
FAILED: test-bus-vtable-cc.p/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
ccache c++ -Itest-bus-vtable-cc. ... -c ../src/libsystemd/sd-bus/test-bus-vtable-cc.cc
In file included from <command-line>:
../src/basic/coverage.h:17:15: error: ‘_Noreturn’ does not name a type
   17 | static inline _Noreturn void _coverage__exit(int status) {
      |               ^~~~~~~~~
../src/basic/coverage.h:46:29: error: conflicting declaration of ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int)’ with ‘C’ linkage
   46 | #define execveat(d,p,a,e,f) _coverage_execveat(d, p, a, e, f)
      |                             ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:34:19: note: previous declaration with ‘C++’ linkage
   34 | static inline int _coverage_execveat(
      |                   ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:46:29: error: declaration of ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int) noexcept’ has a different exception specifier
   46 | #define execveat(d,p,a,e,f) _coverage_execveat(d, p, a, e, f)
      |                             ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:34:19: note: from previous declaration ‘int _coverage_execveat(int, const char*, char* const*, char* const*, int)’
   34 | static inline int _coverage_execveat(
      |                   ^~~~~~~~~~~~~~~~~~
../src/basic/coverage.h:58:24: error: conflicting declaration of ‘int _coverage_execvpe(const char*, char* const*, char* const*)’ with ‘C’ linkage
   58 | #define execvpe(f,a,e) _coverage_execvpe(f, a, e)
      |                        ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:48:19: note: previous declaration with ‘C++’ linkage
   48 | static inline int _coverage_execvpe(
      |                   ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:58:24: error: declaration of ‘int _coverage_execvpe(const char*, char* const*, char* const*) noexcept’ has a different exception specifier
   58 | #define execvpe(f,a,e) _coverage_execvpe(f, a, e)
      |                        ^~~~~~~~~~~~~~~~~
../src/basic/coverage.h:48:19: note: from previous declaration ‘int _coverage_execvpe(const char*, char* const*, char* const*)’
   48 | static inline int _coverage_execvpe(
      |                   ^~~~~~~~~~~~~~~~~
[1582/2109] Compiling C object test-event.p/src_libsystemd_sd-event_test-event.c.o
ninja: build stopped: subcommand failed.

11 months agomeson: Use build_tgt.name() 28036/head
Jan Janssen [Wed, 14 Jun 2023 14:10:55 +0000 (16:10 +0200)] 
meson: Use build_tgt.name()

11 months agomeson: Use fs module in more places
Jan Janssen [Wed, 14 Jun 2023 14:05:52 +0000 (16:05 +0200)] 
meson: Use fs module in more places

11 months agosleep-config: add comment about security
Christoph Anton Mitterer [Sun, 26 Mar 2023 02:31:38 +0000 (04:31 +0200)] 
sleep-config: add comment about security

Adds information about attacks that might become possible when the hibernate
location is automatically determined.

11 months agoMerge pull request #28032 from poettering/mumumµ
Lennart Poettering [Wed, 14 Jun 2023 12:00:10 +0000 (14:00 +0200)] 
Merge pull request #28032 from poettering/mumumµ

deal with µ unicode ambiguities

11 months agoukify: make the certficate validity configurable 27946/head
Zbigniew Jędrzejewski-Szmek [Wed, 14 Jun 2023 10:38:37 +0000 (12:38 +0200)] 
ukify: make the certficate validity configurable

Requested in https://github.com/systemd/systemd/pull/27946/commits/4cc743319ae378d458050d6e0cfdeaa03addd379#r1228592001

11 months agoman/ukify: add structure to describe verbs, document genkey
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jun 2023 10:22:32 +0000 (12:22 +0200)] 
man/ukify: add structure to describe verbs, document genkey

This just adds two paragraphs of text, but moves a lot of the text
one level down into a subsection.

11 months agotest_ukify: skip test requiring cryptography
Zbigniew Jędrzejewski-Szmek [Wed, 7 Jun 2023 08:05:02 +0000 (10:05 +0200)] 
test_ukify: skip test requiring cryptography

I'll add the dep in Fedora spec so it does get tested at least
in some cases.

11 months agoman: add example how to configure automatic signing
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:31:17 +0000 (21:31 +0200)] 
man: add example how to configure automatic signing

Fixes #978.

11 months agotest_ukify: cleanups suggested by pylint
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:07:58 +0000 (21:07 +0200)] 
test_ukify: cleanups suggested by pylint

11 months agoukify: add 'genkey' verb
Zbigniew Jędrzejewski-Szmek [Tue, 6 Jun 2023 19:06:20 +0000 (21:06 +0200)] 
ukify: add 'genkey' verb

The idea is to make it easy to generate all the signing key and certs
that can be used for local signing. The verb is the modeled after
'mkosi genkey', but there are some important differences: we generate
the keys to the paths where they will be read from, both pcr signing
keys and the SecureBoot certificate+key.

If any of the outputs exist, operation is refused. Maybe we could add a
--force option in the future, but this operation should be rare, so I think
it's better to refuse to overwrite anything initially.

I'm only doing a token man page change here.
https://github.com/systemd/systemd/pull/27621 reworks the man page,
and the changes done here would conflict heavily with that work. I'll
submit a follow-up patch later.

11 months agobootctl: fix docs/--help to say that "bootctl random-seed" not just initializes but...
Lennart Poettering [Tue, 13 Jun 2023 14:47:36 +0000 (16:47 +0200)] 
bootctl: fix docs/--help to say that "bootctl random-seed" not just initializes but also refreshes ESP random seeds

11 months agoMerge pull request #28012 from poettering/resolvectl-dump-cache
Lennart Poettering [Wed, 14 Jun 2023 08:33:13 +0000 (10:33 +0200)] 
Merge pull request #28012 from poettering/resolvectl-dump-cache

add "resolvectl show-cache" call and IPC backend for that