]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agotest: add a couple of tests for systemd-run 27891/head
Frantisek Sumsal [Thu, 1 Jun 2023 06:47:51 +0000 (08:47 +0200)] 
test: add a couple of tests for systemd-run

2 years agosocket: avoid memory leak on incomplete SocketPort object
Frantisek Sumsal [Thu, 1 Jun 2023 20:11:01 +0000 (22:11 +0200)] 
socket: avoid memory leak on incomplete SocketPort object

==1==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 17 byte(s) in 1 object(s) allocated from:
    #0 0x7fc096c7243b in strdup (/lib64/libasan.so.8+0x7243b)
    #1 0x7fc095db3899 in bus_socket_set_transient_property ../src/core/dbus-socket.c:386
    #2 0x7fc095db5140 in bus_socket_set_property ../src/core/dbus-socket.c:460
    #3 0x7fc095dd20f1 in bus_unit_set_properties ../src/core/dbus-unit.c:2473
    #4 0x7fc095d87d53 in transient_unit_from_message ../src/core/dbus-manager.c:1025
    #5 0x7fc095d8872f in method_start_transient_unit ../src/core/dbus-manager.c:1112
    #6 0x7fc0944ddf4f in method_callbacks_run ../src/libsystemd/sd-bus/bus-objects.c:406
    #7 0x7fc0944e7854 in object_find_and_run ../src/libsystemd/sd-bus/bus-objects.c:1319
    #8 0x7fc0944e8f03 in bus_process_object ../src/libsystemd/sd-bus/bus-objects.c:1439
    #9 0x7fc09454ad78 in process_message ../src/libsystemd/sd-bus/sd-bus.c:3011
    #10 0x7fc09454b302 in process_running ../src/libsystemd/sd-bus/sd-bus.c:3053
    #11 0x7fc09454e158 in bus_process_internal ../src/libsystemd/sd-bus/sd-bus.c:3273
    #12 0x7fc09454e2f2 in sd_bus_process ../src/libsystemd/sd-bus/sd-bus.c:3300
    #13 0x7fc094551a59 in io_callback ../src/libsystemd/sd-bus/sd-bus.c:3642
    #14 0x7fc094727830 in source_dispatch ../src/libsystemd/sd-event/sd-event.c:4187
    #15 0x7fc094731009 in sd_event_dispatch ../src/libsystemd/sd-event/sd-event.c:4808
    #16 0x7fc094732124 in sd_event_run ../src/libsystemd/sd-event/sd-event.c:4869
    #17 0x7fc095f7af9f in manager_loop ../src/core/manager.c:3242
    #18 0x41cc7c in invoke_main_loop ../src/core/main.c:1937
    #19 0x4252e0 in main ../src/core/main.c:3072
    #20 0x7fc092a4a50f in __libc_start_call_main (/lib64/libc.so.6+0x2750f)

SUMMARY: AddressSanitizer: 17 byte(s) leaked in 1 allocation(s).

2 years agodbus-util: let's take it down a notch when converting file mode to string
Frantisek Sumsal [Thu, 1 Jun 2023 18:22:20 +0000 (20:22 +0200)] 
dbus-util: let's take it down a notch when converting file mode to string

I'm definitely a fan of precision, but in this case it's a bit too much:

    $ systemd-run --unit=test --socket-property=ListenFIFO=/tmp/foo --socket-property=SocketMode=0644 true
    $ systemctl cat test.socket
    # /run/systemd/transient/test.socket
    # This is a transient unit file, created programmatically via the systemd API. Do not edit.
    [Unit]
    Description=/usr/bin/true

    [Socket]
    ListenFIFO=/tmp/foo
    SocketMode=0000000000000000000000000000000000000644

2 years agotest: make the multiple-file test more thorough
Frantisek Sumsal [Thu, 1 Jun 2023 18:02:20 +0000 (20:02 +0200)] 
test: make the multiple-file test more thorough

Let's check if we keep the old records after multiple systemd-pstore
invocations (i.e. simulate a scenario where we get multiple crashes and
multiple machine reboots).

2 years agosd-journal: fix assignment of tail entry offset
Yu Watanabe [Tue, 16 May 2023 21:02:00 +0000 (06:02 +0900)] 
sd-journal: fix assignment of tail entry offset

Fixes a bug introduced by 206f0f397edf1144c63a158fb30f496c3e89f256.

2 years agobuild(deps): bump github/codeql-action from 2.2.9 to 2.3.5
dependabot[bot] [Thu, 1 Jun 2023 09:57:12 +0000 (09:57 +0000)] 
build(deps): bump github/codeql-action from 2.2.9 to 2.3.5

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.9 to 2.3.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/04df1262e6247151b5ac09cd2c303ac36ad3f62b...0225834cc549ee0ca93cb085b92954821a145866)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump meson from 1.1.0 to 1.1.1 in /.github/workflows
dependabot[bot] [Thu, 1 Jun 2023 09:57:18 +0000 (09:57 +0000)] 
build(deps): bump meson from 1.1.0 to 1.1.1 in /.github/workflows

Bumps [meson](https://github.com/mesonbuild/meson) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/mesonbuild/meson/releases)
- [Commits](https://github.com/mesonbuild/meson/compare/1.1.0...1.1.1)

---
updated-dependencies:
- dependency-name: meson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agotest: make TEST-04 stable once again
Frantisek Sumsal [Thu, 1 Jun 2023 07:07:28 +0000 (09:07 +0200)] 
test: make TEST-04 stable once again

Wait a bit if necessary for the cursor file to appear.

Follow-up fb35feae97.

2 years agoMerge pull request #27874 from keszybz/test-bus-server-shortening
Yu Watanabe [Thu, 1 Jun 2023 12:10:55 +0000 (21:10 +0900)] 
Merge pull request #27874 from keszybz/test-bus-server-shortening

Simplify the code in test-bus-server

2 years agotest-sizeof: let's be a tiny bit more careful when using glibc internal types
Lennart Poettering [Thu, 1 Jun 2023 08:46:47 +0000 (10:46 +0200)] 
test-sizeof: let's be a tiny bit more careful when using glibc internal types

One can argue that internal glibc types (i.e. those starting with __)
are not really part of the glibc API, hence let's at least ifdef them.

2 years agobuild(deps): bump redhat-plumbers-in-action/advanced-issue-labeler
dependabot[bot] [Thu, 1 Jun 2023 09:57:18 +0000 (09:57 +0000)] 
build(deps): bump redhat-plumbers-in-action/advanced-issue-labeler

Bumps [redhat-plumbers-in-action/advanced-issue-labeler](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler) from 2.0.4 to 2.0.6.
- [Release notes](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/releases)
- [Commits](https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/compare/25a1e41826424cdf577c71b58c852df4347f13b8...71bcf99aef4b9ea844db9a43755e8ac02c8e661e)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/advanced-issue-labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump actions/labeler from 4.0.3 to 4.0.4
dependabot[bot] [Thu, 1 Jun 2023 09:57:05 +0000 (09:57 +0000)] 
build(deps): bump actions/labeler from 4.0.3 to 4.0.4

Bumps [actions/labeler](https://github.com/actions/labeler) from 4.0.3 to 4.0.4.
- [Release notes](https://github.com/actions/labeler/releases)
- [Commits](https://github.com/actions/labeler/compare/ba790c862c380240c6d5e7427be5ace9a05c754b...0776a679364a9a16110aac8d0f40f5e11009e327)

---
updated-dependencies:
- dependency-name: actions/labeler
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Thu, 1 Jun 2023 09:57:07 +0000 (09:57 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 4.0.2 to 4.2.2.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/d24099b9f39ddee81dea31eb0e135e0a623cb2b8...ac4483d8c6713bd2011037f44fe626989468af74)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2 years agoMerge pull request #27856 from arianvp/fix-bootctl-status
Zbigniew Jędrzejewski-Szmek [Thu, 1 Jun 2023 08:25:30 +0000 (10:25 +0200)] 
Merge pull request #27856 from arianvp/fix-bootctl-status

bootctl: Print version number of detected binaries again

2 years agotest-bus-server: simplify return value handling 27874/head
Zbigniew Jędrzejewski-Szmek [Wed, 31 May 2023 15:22:23 +0000 (17:22 +0200)] 
test-bus-server: simplify return value handling

Follow-up for f7794e423ae79325bdbf7b3637b7cb7a1a57e62e.

2 years agovarious: remove typo/unusual spelling
Zbigniew Jędrzejewski-Szmek [Wed, 31 May 2023 15:17:26 +0000 (17:17 +0200)] 
various: remove typo/unusual spelling

Wikitionary says that "noone" is known, but not preferred by a large margin.
(It's also an obsolete spelling of "noon".)

2 years agoMerge pull request #27796 from yuwata/memstream-util
Yu Watanabe [Thu, 1 Jun 2023 03:07:17 +0000 (12:07 +0900)] 
Merge pull request #27796 from yuwata/memstream-util

util: introduce memstream-util

2 years agonetworkd/dhcpserver: Save and expose the client hostname sent when requesting a DHCP...
Rene Hollander [Sat, 27 May 2023 11:33:37 +0000 (13:33 +0200)] 
networkd/dhcpserver: Save and expose the client hostname sent when requesting a DHCP lease.

DHCP clients often send their own hostname in option 12. It can be useful
to store it with the lease so it can be shown to a human to easily identify
which lease belongs to which device.

RFC: https://www.rfc-editor.org/rfc/rfc2132#section-3.14

2 years agotree-wide: use memstream-util 27796/head
Yu Watanabe [Fri, 26 May 2023 06:40:12 +0000 (15:40 +0900)] 
tree-wide: use memstream-util

2 years agoutil: introduce memstream-util
Yu Watanabe [Fri, 26 May 2023 06:22:03 +0000 (15:22 +0900)] 
util: introduce memstream-util

There is many pitfalls in using memstream.
Let's introduce a wrapper to make us safely use it.

2 years agocalendarspec: rename arguments
Yu Watanabe [Sun, 28 May 2023 14:03:26 +0000 (23:03 +0900)] 
calendarspec: rename arguments

2 years agoelf-util: rename stack_context_destroy() -> stack_context_done()
Yu Watanabe [Sun, 28 May 2023 13:56:02 +0000 (22:56 +0900)] 
elf-util: rename stack_context_destroy() -> stack_context_done()

2 years agosd-bus: rename introspect_free() -> introspect_done
Yu Watanabe [Sun, 28 May 2023 13:53:23 +0000 (22:53 +0900)] 
sd-bus: rename introspect_free() -> introspect_done

2 years agotree-wide: use _cleanup_set_free_ and friends
Yu Watanabe [Sun, 28 May 2023 13:33:44 +0000 (22:33 +0900)] 
tree-wide: use _cleanup_set_free_ and friends

Instead of _cleanup_(set_freep) or so.

2 years agooomd: drop unused key
Yu Watanabe [Sun, 28 May 2023 12:43:45 +0000 (21:43 +0900)] 
oomd: drop unused key

2 years agocore/cgroup: fix setting SocketBindAllow=/SocketBindDeny= through DBus
Yu Watanabe [Sun, 28 May 2023 06:46:14 +0000 (15:46 +0900)] 
core/cgroup: fix setting SocketBindAllow=/SocketBindDeny= through DBus

2 years agocore/transaction: drop job that has unfulfilled required (Requires, BindsTo) dependencies
Michal Sekletar [Tue, 30 May 2023 13:47:16 +0000 (15:47 +0200)] 
core/transaction: drop job that has unfulfilled required (Requires, BindsTo) dependencies

Resolves: #11338

2 years agoman: vconsole.conf: replace the hardcoded keymap with build-time default
Mike Yuan [Wed, 31 May 2023 13:10:46 +0000 (21:10 +0800)] 
man: vconsole.conf: replace the hardcoded keymap with build-time default

Follow-up for #26089

2 years agotest: skip the test early if we're built without systemd-homed
Frantisek Sumsal [Wed, 31 May 2023 13:40:33 +0000 (15:40 +0200)] 
test: skip the test early if we're built without systemd-homed

We check for homed stuff in the test itself, but this is way too late,
since we already started a unit that Requires=systemd-homed.service
(testsuite-46.service). For now this doesn't matter, but with #27852
the offending transaction is dropped from the job queue, making the test
fail.

Spotted in #27852 in Ubuntu CI.

2 years agoMerge pull request #27826 from yuwata/network-link-ready-without-ndisc-when-has-stati...
Yu Watanabe [Wed, 31 May 2023 21:29:55 +0000 (06:29 +0900)] 
Merge pull request #27826 from yuwata/network-link-ready-without-ndisc-when-has-static-address

network: do not request dynamic addressing protocols finished when at…

2 years agoMerge pull request #27628 from ddstreet/tpm2_header_cleanup
Daan De Meyer [Wed, 31 May 2023 21:06:14 +0000 (23:06 +0200)] 
Merge pull request #27628 from ddstreet/tpm2_header_cleanup

Tpm2 header cleanup

2 years agoMerge pull request #27844 from DaanDeMeyer/repart-arch
Daan De Meyer [Wed, 31 May 2023 21:00:19 +0000 (23:00 +0200)] 
Merge pull request #27844 from DaanDeMeyer/repart-arch

repart: Add --architecture option

2 years agowait-online: request that at least one managed online interface exists
Yu Watanabe [Mon, 29 May 2023 03:37:44 +0000 (12:37 +0900)] 
wait-online: request that at least one managed online interface exists

Fixes a regression caused by ab3aed4a0349bbaa26f53340770c1b59b463e05d.

I thought the commit does not cause any severe regression. However,
drivers for network interfaces may be loaded later. So, we should wait
if no network interface is found.

Fixes #27822.

2 years agohwdb: add support for Elgato Stream Deck mini (gen 2)
Times-Z [Wed, 31 May 2023 16:44:09 +0000 (18:44 +0200)] 
hwdb: add support for Elgato Stream Deck mini (gen 2)

2 years agounits: pull in local-fs-pre.target from systemd-tmpfiles-setup-dev.service
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 16:44:46 +0000 (18:44 +0200)] 
units: pull in local-fs-pre.target from systemd-tmpfiles-setup-dev.service

local-fs-pre.target is a passive unit, which means that it is supposed to be
pulled in by everything that is ordered before it. We had
Before=local-fs-pre.target, so add Wants= too.

I don't expect this to change anything. Instead, just make things follow the
docs so it's easier to reason about the dependency set.

2 years agoMerge pull request #27861 from poettering/find-esp-tweaks
Lennart Poettering [Wed, 31 May 2023 13:42:05 +0000 (15:42 +0200)] 
Merge pull request #27861 from poettering/find-esp-tweaks

minor tweaks to find-esp.c

2 years agoMerge pull request #27806 from DaanDeMeyer/fix-mkosi-check
Daan De Meyer [Wed, 31 May 2023 13:26:05 +0000 (15:26 +0200)] 
Merge pull request #27806 from DaanDeMeyer/fix-mkosi-check

mkosi: Use proper check to detect whether we're in a VM

2 years agotpm2: sort tpm2 symbol list 27628/head
Dan Streetman [Thu, 16 Feb 2023 23:10:55 +0000 (18:10 -0500)] 
tpm2: sort tpm2 symbol list

Only cosmetic, no functional change.

2 years agotpm2: remove all extern tpm2-tss symbols
Dan Streetman [Fri, 5 May 2023 23:49:49 +0000 (19:49 -0400)] 
tpm2: remove all extern tpm2-tss symbols

These library syms should be restricted to use only in tpm2-util.c,
and all other code should use simpler functions exported in tpm2-util.h.

Also move the Esys_Freep() cleanup function into tpm-util.c, and make
tpm2-tss symbols static.

2 years agotpm: remove external calls to dlopen_tpm2()
Dan Streetman [Fri, 5 May 2023 23:53:32 +0000 (19:53 -0400)] 
tpm: remove external calls to dlopen_tpm2()

The calls outside tpm2-util.c are redundant, as tpm2_context_new()
is always called immediately after, which then calls dlopen_tpm2().

2 years agoMerge pull request #27766 from rphibel/cleanup-cgroups-before-cleaning-units
Daan De Meyer [Wed, 31 May 2023 12:48:42 +0000 (14:48 +0200)] 
Merge pull request #27766 from rphibel/cleanup-cgroups-before-cleaning-units

Don't GC unit if it is in cgroup_empty_queue

2 years agoMerge pull request #26969 from DaanDeMeyer/xopenat-label
Daan De Meyer [Wed, 31 May 2023 12:35:50 +0000 (14:35 +0200)] 
Merge pull request #26969 from DaanDeMeyer/xopenat-label

fs-util: Add labelling support to xopenat()

2 years agobootctl: also print efi files not owned by systemd in status 27856/head
Arian van Putten [Wed, 31 May 2023 11:27:13 +0000 (13:27 +0200)] 
bootctl: also print efi files not owned by systemd in status

We should not skip over unknown entries in EFI/BOOT/ but
also print them out in status so people are aware that they are there.

2 years agomkosi: Check for failures by mounting again 27806/head
Daan De Meyer [Wed, 31 May 2023 11:03:18 +0000 (13:03 +0200)] 
mkosi: Check for failures by mounting again

We rely on vsock to communicate the exit status back to us from the
VM but vsock in Github Actions is broken so let's switch back to
mounting for now.

2 years agomkosi: Don't fail on systemd-vconsole-setup.service failure for now
Daan De Meyer [Wed, 31 May 2023 12:21:49 +0000 (14:21 +0200)] 
mkosi: Don't fail on systemd-vconsole-setup.service failure for now

Let's make CI green again and dig into this failure later

2 years agomkosi: Disable cmdline addon test for now
Daan De Meyer [Wed, 31 May 2023 11:24:10 +0000 (13:24 +0200)] 
mkosi: Disable cmdline addon test for now

This fails but we didn't notice until now because error reporting
from the mkosi VM was broken. Let's disable it for now to get CI
green again.

2 years agomkosi: Use proper check to detect whether we're in a VM
Daan De Meyer [Fri, 26 May 2023 15:38:23 +0000 (17:38 +0200)] 
mkosi: Use proper check to detect whether we're in a VM

2 years agomkosi: Blacklist vmw_vmci to avoid issues with vsock in Github Actions
Daan De Meyer [Tue, 30 May 2023 12:48:43 +0000 (14:48 +0200)] 
mkosi: Blacklist vmw_vmci to avoid issues with vsock in Github Actions

If this module is loaded, sending readiness notifications from the
VM will fail with "no route to host" so let's blacklist the module
to prevent that from happening.

2 years agomkosi: Enforce usage of vsock with qemu in CI
Daan De Meyer [Sat, 27 May 2023 09:12:22 +0000 (11:12 +0200)] 
mkosi: Enforce usage of vsock with qemu in CI

2 years agomkosi: Update to latest
Daan De Meyer [Sat, 27 May 2023 09:12:11 +0000 (11:12 +0200)] 
mkosi: Update to latest

2 years agosd-daemon: Add debug logging
Daan De Meyer [Wed, 31 May 2023 08:22:57 +0000 (10:22 +0200)] 
sd-daemon: Add debug logging

2 years agosd-daemon: Introduce pid_notify_with_fds_internal()
Daan De Meyer [Wed, 31 May 2023 08:08:47 +0000 (10:08 +0200)] 
sd-daemon: Introduce pid_notify_with_fds_internal()

No change in behavior, just refactoring

2 years agosysv-generator-test: Bump log level to info
Daan De Meyer [Wed, 31 May 2023 12:18:35 +0000 (14:18 +0200)] 
sysv-generator-test: Bump log level to info

Otherwise, non-fatal debug error logs might interfere with the test.

2 years agoMerge pull request #27860 from poettering/loopback-no-prefix-route
Lennart Poettering [Wed, 31 May 2023 12:03:04 +0000 (14:03 +0200)] 
Merge pull request #27860 from poettering/loopback-no-prefix-route

loopback-setup: only create a single loopback route when configuring 'lo'

2 years agorepart: Add --architecture option 27844/head
Daan De Meyer [Tue, 30 May 2023 08:11:23 +0000 (10:11 +0200)] 
repart: Add --architecture option

This option allows overriding the architecture that's used for the
architecture specific partition types. This is useful to allow
reusing the same repart configuration to produce the same image for
different architectures.

2 years agogpt: Add gpt_partition_type_override_architecture()
Daan De Meyer [Wed, 31 May 2023 11:44:00 +0000 (13:44 +0200)] 
gpt: Add gpt_partition_type_override_architecture()

Let's add a function that allows changing the architecture of a given
partition type.

2 years agogpt: Use FOREACH_ARRAY
Daan De Meyer [Wed, 31 May 2023 11:32:23 +0000 (13:32 +0200)] 
gpt: Use FOREACH_ARRAY

2 years agofs-util: Add XOpenFlags with XO_LABEL flag to have xopenat() MAC label files/dirs 26969/head
Daan De Meyer [Sun, 26 Mar 2023 17:48:57 +0000 (19:48 +0200)] 
fs-util: Add XOpenFlags with XO_LABEL flag to have xopenat() MAC label files/dirs

2 years agolabel: Introduce LabelOps to do pre/post labelling operations
Daan De Meyer [Sun, 26 Mar 2023 16:20:41 +0000 (18:20 +0200)] 
label: Introduce LabelOps to do pre/post labelling operations

By default, label_ops is initialized with a NULL pointer which translates
to noop labelling operations. In mac_selinux_init() and the new mac_smack_init(),
we initialize label_ops with a MAC specific LabelOps pointer.

We also introduce mac_init() to initialize any configured MACs and replace all
usages of mac_selinux_init() with mac_init().

2 years agoMerge pull request #27848 from keszybz/man-page-fixes
Luca Boccassi [Wed, 31 May 2023 10:13:51 +0000 (11:13 +0100)] 
Merge pull request #27848 from keszybz/man-page-fixes

Man page fixes

2 years agoMerge pull request #27858 from mrc0mmand/followups
Luca Boccassi [Wed, 31 May 2023 10:09:53 +0000 (11:09 +0100)] 
Merge pull request #27858 from mrc0mmand/followups

Use structured initialization in two more places

2 years agoMerge pull request #27853 from keszybz/various-bits-and-pieces-included-to-reuse...
Luca Boccassi [Wed, 31 May 2023 10:08:36 +0000 (11:08 +0100)] 
Merge pull request #27853 from keszybz/various-bits-and-pieces-included-to-reuse-the-ci-run

Various bits and pieces included to reuse the ci run

2 years agoMerge pull request #27840 from mrc0mmand/gcc-13
Luca Boccassi [Wed, 31 May 2023 10:07:22 +0000 (11:07 +0100)] 
Merge pull request #27840 from mrc0mmand/gcc-13

ci: add gcc-13, drop gcc-12

2 years agoMerge pull request #27519 from yuwata/journalctl-fixes
Luca Boccassi [Wed, 31 May 2023 10:05:54 +0000 (11:05 +0100)] 
Merge pull request #27519 from yuwata/journalctl-fixes

journalctl: several fixes and cleanups for --follow

2 years agoMerge pull request #27835 from keszybz/test-58-repart-modernization
Luca Boccassi [Wed, 31 May 2023 10:00:18 +0000 (11:00 +0100)] 
Merge pull request #27835 from keszybz/test-58-repart-modernization

Cleanup/simplifications for TEST-58-repart

2 years agotest-fstab-generator: fix test on systemd with systemd-boot
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 20:53:43 +0000 (22:53 +0200)] 
test-fstab-generator: fix test on systemd with systemd-boot

(… or other boot loaders implementing the Boot Loader Interface.)

Fixes #27857.

2 years agotest-loopback: run test in network + user namespace 27860/head
Lennart Poettering [Wed, 31 May 2023 07:41:26 +0000 (09:41 +0200)] 
test-loopback: run test in network + user namespace

This way it can actually do useful testing even when unprivileged.

2 years agoloopback-setup: clean up logging
Lennart Poettering [Wed, 31 May 2023 07:57:33 +0000 (09:57 +0200)] 
loopback-setup: clean up logging

All users of loopback_setup() ignore the return values (with the notable
exception of the test cases). Hence let's adjust the log messaging to
always log at LOG_WARNING level at most, and suffix messages with ",
ignoring", to make clear these failures are ignored.

2 years agoloopback-setup: set IFA_F_NOPREFIXROUTE when configuring 'lo' ipv6 address
Lennart Poettering [Wed, 31 May 2023 07:42:45 +0000 (09:42 +0200)] 
loopback-setup: set IFA_F_NOPREFIXROUTE when configuring 'lo' ipv6 address

Otherwise the kernel will set up two routes to ::1, one in the "main",
and one in the "local" routing table.

Fixes: #25819
2 years agofind-esp: drop some redundant 'else' 27861/head
Lennart Poettering [Wed, 31 May 2023 07:37:24 +0000 (09:37 +0200)] 
find-esp: drop some redundant 'else'

2 years agofind-esp: change "unprivileged_mode" parameter to be tristate
Lennart Poettering [Wed, 31 May 2023 07:32:52 +0000 (09:32 +0200)] 
find-esp: change "unprivileged_mode" parameter to be tristate

Previously, unprivileged mode for find_esp_and_warn() and
find_xbootldr_and_warn() could be enabled or disabled. With this change
it can also be set to negative in which case the functions will enable
it automatically if found to be executing without privileges.

This just moves te geteuid() check we often do for the param inside of
the functions.

At the same time internally in the functions we also pass around the
VerifyESPFlags field across the various functions instead of booleans.

Both changes are just refactoring. No changes in behaviour.

2 years agotmpfiles: use same credstore perms everywhere
Lennart Poettering [Tue, 30 May 2023 13:13:38 +0000 (15:13 +0200)] 
tmpfiles: use same credstore perms everywhere

In b6033b706028a64e9affb79050ced1ad9a4f5b43 support was added to create
{/etc|/run}/credstore{|.encrypted} via tmpfiles.d with perms 0000. These
perms are so restrictive that not even root can access them unless it
has CAP_DAC_OVERRIDE capability. This is creates the dirs at boot time

In 24039e1207c169b18adf5234ad300ea3ba1b671e support was added to create
/etc/credstore with perm 0700 from meson.build at build time.

This patch makes unifies the two parts:

1. creates both /etc/credstore *and* /etc/credstore.encrypted in both
   places (the build system still won't create them in /run/, since
   that's pointless since not shipped, and the runtime won't create the
   dirs below /usr/lib/, since that's not generically writable anyway).

2. Both at runtime and at build time we'll create the dirs with mode
   0700. This is easier for packaging tools to handle since they
   generally react pretty negatively on dirs they can't enumerate.

2 years agosd-network: use structured initialization 27858/head
Frantisek Sumsal [Tue, 30 May 2023 19:29:54 +0000 (21:29 +0200)] 
sd-network: use structured initialization

And squash one unnecessary assignment.

2 years agojournal-remote: use structured initialization
Frantisek Sumsal [Tue, 30 May 2023 19:18:08 +0000 (21:18 +0200)] 
journal-remote: use structured initialization

2 years agobootctl: Print version number of detected binaries
Arian van Putten [Tue, 30 May 2023 17:12:36 +0000 (19:12 +0200)] 
bootctl: Print version number of detected binaries

In 9b9f6aa41204c995b7a3b3e99c50e92b0a8b3dde (#27069)
we changed get_file_version to return 0 instead of 1 on success.
However we did not update the printing of the version number to
handle this change so we would never print the version number.

2 years agocore,shared: add a couple of asserts 27840/head
Frantisek Sumsal [Tue, 30 May 2023 10:40:19 +0000 (12:40 +0200)] 
core,shared: add a couple of asserts

To appease the LTO overlords:

In file included from ../../../../src/basic/macro.h:446,
                 from ../../../../src/shared/blockdev-util.h:8,
                 from ../../../../src/shared/creds-util.c:11:
../../../../src/shared/creds-util.c: In function 'get_credential_host_secret':
../../../../src/shared/creds-util.c:379:52: error: '%s' directive argument is null [-Werror=format-overflow=]
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../src/basic/log.h:214:86: note: in definition of macro 'log_full_errno_zerook'
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../../../../src/basic/log.h:250:41: note: in expansion of macro 'log_full_errno'
  250 | #define log_debug_errno(error, ...)     log_full_errno(LOG_DEBUG,   error, __VA_ARGS__)
      |                                         ^~~~~~~~~~~~~~
../../../../src/shared/creds-util.c:379:33: note: in expansion of macro 'log_debug_errno'
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                 ^~~~~~~~~~~~~~~
../../../../src/shared/creds-util.c:379:74: note: format string is defined here
  379 |                                 log_debug_errno(r, "Credential secret %s/%s appeared while we were creating it, rereading.",
      |                                                                          ^~
cc1: some warnings being treated as errors

../../../../src/core/transaction.c: In function 'transaction_verify_order_one':
../../../../src/core/transaction.c:338:38: error: '%s' directive argument is null [-Werror=format-overflow=]
  338 |                 sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
      |                                      ^~
cc1: some warnings being treated as errors

2 years agoci: add gcc-13, drop gcc-12
Frantisek Sumsal [Tue, 30 May 2023 07:07:39 +0000 (09:07 +0200)] 
ci: add gcc-13, drop gcc-12

2 years agotest-dlopen: allow loading of multiple libraries 27853/head
Zbigniew Jędrzejewski-Szmek [Tue, 18 Apr 2023 09:37:52 +0000 (11:37 +0200)] 
test-dlopen: allow loading of multiple libraries

This is useful for debugging, for example if we want to test multiple different
dlls being loaded in the same namespace.

2 years agoshared/loop-util: add comment
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 13:56:45 +0000 (15:56 +0200)] 
shared/loop-util: add comment

Requested in https://github.com/systemd/systemd/commit/afbe20b7d4ed4c3aebbd1b3de00b9b7385dd0ae8#r115653459.

2 years agotests: drop unnecessary redirection of stderr
Zbigniew Jędrzejewski-Szmek [Mon, 29 May 2023 10:28:34 +0000 (12:28 +0200)] 
tests: drop unnecessary redirection of stderr

command -v doesn't print anything to stderr, let's use the canonical
form with just >/dev/null.

2 years agodissect: use pager for --help
Zbigniew Jędrzejewski-Szmek [Tue, 23 May 2023 19:26:57 +0000 (21:26 +0200)] 
dissect: use pager for --help

This output is already too long to fit on an normal terminal, and the
interesting parts are towards the top.

2 years agobasic/user-util: attach pointer symbol to return type, not function
Zbigniew Jędrzejewski-Szmek [Tue, 23 May 2023 11:46:59 +0000 (13:46 +0200)] 
basic/user-util: attach pointer symbol to return type, not function

Surrounding code was predominantly using this style already, let's make things
consistent.

2 years agolabel: Rename to label-util.h
Daan De Meyer [Sun, 26 Mar 2023 16:01:07 +0000 (18:01 +0200)] 
label: Rename to label-util.h

2 years agotest-udev: Skip running in container
Daan De Meyer [Sat, 27 May 2023 10:21:19 +0000 (12:21 +0200)] 
test-udev: Skip running in container

Containers generally don't have permission to mknod() which is
required by test-udev so let's skip the test as well if we detect
we're running in a container.

2 years agooom: Make sure temporary test file is in /tmp
Daan De Meyer [Sat, 27 May 2023 09:43:10 +0000 (11:43 +0200)] 
oom: Make sure temporary test file is in /tmp

2 years agokmod-setup: Load virtio-vsock kernel module early
Daan De Meyer [Sat, 27 May 2023 09:32:39 +0000 (11:32 +0200)] 
kmod-setup: Load virtio-vsock kernel module early

We might want to send sd-notify over vsock very early on so let's
make sure we load the relevant kernel module as early as possible.

2 years agogpt: Fix copy paste error
Daan De Meyer [Tue, 30 May 2023 11:30:08 +0000 (13:30 +0200)] 
gpt: Fix copy paste error

2 years agorepart: Allow target directory excludes
Daan De Meyer [Mon, 22 May 2023 21:17:49 +0000 (23:17 +0200)] 
repart: Allow target directory excludes

Currently, ExcludeFiles= supports excluding directories on the host
from being copied. Let's extend this to also support preventing files
from being copied into specific directories in the partition by adding
a new option ExcludeFilesTarget=. An example where this is useful is
when setting up btrfs subvolumes in the top level that are intended to
be mounted into specific locations, so /usr would be stored in @usr,
/home in @home, .... To accomplish this, we need to copy /usr to @usr
and prevent any files from being copied into /usr in the partition,
which with this commit, we'd be able to do as follows:

```
[Partition]
CopyFiles=/usr:@usr
ExcludeFilesTarget=/usr
```

2 years agoshared/loop-util: use longer delay when waiting for loop device
Zbigniew Jędrzejewski-Szmek [Mon, 29 May 2023 22:20:30 +0000 (00:20 +0200)] 
shared/loop-util: use longer delay when waiting for loop device

The kernel may be syncing a file system or doing something else that requires
more time. So make the delay a bit longer, but provide some feedback and also
grow the delay exponentially (though with a long exponent). If the kernel is
doing something else, no need to repeat so often. With 38 attempts, we get a
total of slightly above 5000 ms.

I wrote this when I thought that the the delay is not long enough. It turned
out that we were blocking the file system on the loop device, so waiting longer
wasn't helpful. But I think it's nicer to do it this way anyway.

2 years agoman: extend description of .target a bit 27848/head
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 11:35:18 +0000 (13:35 +0200)] 
man: extend description of .target a bit

The man page is reference documentation, so we shouldn't write too much
duplicate things here, but we can make the text a bit more approachable. This
rewords and extends the documentation as requested and suggested in #24231 and
adds some hints for the user.

Closes #24231.

2 years agoman/systemd-gpt-auto-generator: mention that swap may be on luks too
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 09:28:48 +0000 (11:28 +0200)] 
man/systemd-gpt-auto-generator: mention that swap may be on luks too

Fixes #25972.

2 years agoman/systemctl: say that kexec loads the kernel, mention --force
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 09:12:26 +0000 (11:12 +0200)] 
man/systemctl: say that kexec loads the kernel, mention --force

Fixes #24588.
Fixes #15029.

2 years agoman/repart: document partition creation order
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 08:43:29 +0000 (10:43 +0200)] 
man/repart: document partition creation order

Fixes #22974.

The text is reworded a bit too. In particular, it's "partitions" that are not
reordered, not "partition table slots". If we were reordering things, we'd move
the partitions between slots. The slots themselves are not moveable.

2 years agoMerge pull request #27842 from keszybz/man-page-links
Zbigniew Jędrzejewski-Szmek [Tue, 30 May 2023 11:40:45 +0000 (13:40 +0200)] 
Merge pull request #27842 from keszybz/man-page-links

Man page formatting and links and such

2 years agoFix failing test 27766/head
Richard Phibel [Mon, 29 May 2023 22:45:09 +0000 (00:45 +0200)] 
Fix failing test

In test-execute, only the unit was started, not the slice. Because of
that the slice cgroup was pruned even if it was still needed. From what
I can tell, this is because, in the test, we don't have all the
mechanics that starts the slice for a service. To fix the issue the
slice is started manually.

2 years agonetwork: do not request dynamic addressing protocols finished when at least one stati... 27826/head
Yu Watanabe [Mon, 29 May 2023 03:56:30 +0000 (12:56 +0900)] 
network: do not request dynamic addressing protocols finished when at least one static address is configured

The setting IPv6AcceptRA= is defaults to yes, hence, even if a .network
file for an interface has static IP address configuration, it may takes
few seconds for the interface being configured state, as NDisc for the
interface needs to be finished. That makes wait-online.service
needlessly slow. Typically, such delay is not necessary for statically
configured networks.

Let's make the required condition slightly relaxed; if a .network file
has static IP address configurations, then let's make the matching
interface enter the 'configured' state soon after the static addresses
configured on the interface.

Note, this does not change the default for IPv6AcceptRA=, hence, NDisc
still runs on interfaces by default. So, addresses, routes, DNS servers,
and so on based on RA will be assigned on interfaces later.

Strictly speaking, this breaks backward compatibility, but the previous
behavior is not clearly documented. If a user requested both static
IPv4 address and IPv6 SLAAC address configured before an interface being
entered to the 'configured' state, then '--ipv6' for wait-online can be
used. So, the behavior change should not cause severe regression.

Closes #27779.

2 years agonetwork: require DHCP protocol to be finished when an address of delegated prefix...
Yu Watanabe [Tue, 30 May 2023 06:29:05 +0000 (15:29 +0900)] 
network: require DHCP protocol to be finished when an address of delegated prefix is assigned

2 years agomeson: use -Werror=strict-flex-arrays
Frantisek Sumsal [Tue, 30 May 2023 08:30:15 +0000 (10:30 +0200)] 
meson: use -Werror=strict-flex-arrays

2 years agoboot: make Event a standard-conforming flexible array
Frantisek Sumsal [Tue, 30 May 2023 08:21:26 +0000 (10:21 +0200)] 
boot: make Event a standard-conforming flexible array

2 years agoman: mention that udevadm verify also checks for udev rules style issues
Dmitry V. Levin [Mon, 29 May 2023 08:00:00 +0000 (08:00 +0000)] 
man: mention that udevadm verify also checks for udev rules style issues

Starting with commit acc1954a0394, udevadm verify also checks token
delimiters, which are not necessarily a matter of udev rules syntax,
but rather a question of style and readability.  Mention that in the
documentation to avoid confusion.

Suggested-by: Martin Wilck <mwilck@suse.com>
Complements: acc1954a0394 ("udev-rules: check token delimiters")