]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 months agosystemctl: certainly ignore ENOENT in checking inhibitors
Yu Watanabe [Thu, 2 Jan 2025 12:15:02 +0000 (21:15 +0900)] 
systemctl: certainly ignore ENOENT in checking inhibitors

Fixes a bug caused by 804874d26ac73e0af07c4c5d7165c95372f03f6d.

Follow-up for 084f361b509cbffe7ffd5ab6085469f76f799fe5 and
a1417e5563acb73a0accdc12b3af91e4ec1c7f46.

Note, ERRNO_IS_NEG_DISCONNECT() includes ENONET rather than ENOENT...
So, ENOENT needs to be handled explicitly.

Fixes #35757 and #35806.

(cherry picked from commit 66f379b63ddac8c72b9130df86a82b68ec42c119)

10 months agosystemctl: also ignore ENOENT in checking inhibitors
Yu Watanabe [Sat, 28 Dec 2024 04:36:32 +0000 (13:36 +0900)] 
systemctl: also ignore ENOENT in checking inhibitors

Fixes a bug caused by 804874d26ac73e0af07c4c5d7165c95372f03f6d.
Follow-up for a1417e5563acb73a0accdc12b3af91e4ec1c7f46.
Fixes #35757.

(cherry picked from commit 084f361b509cbffe7ffd5ab6085469f76f799fe5)

10 months agoobs: also trigger Fedora package builds
Luca Boccassi [Tue, 7 Jan 2025 00:40:02 +0000 (00:40 +0000)] 
obs: also trigger Fedora package builds

The package is logistically separated, as the rpm sources conflict from Fedora
conflict with the rpm sources from SUSE (some files have the same name and
location but different, incompatible content), so Fedora builds can't be
triggered from the same package. The result is the same.

(cherry picked from commit 5c4cb68390a4a3b60d2ca733e283c44fcc205df7)

10 months agoCI: add OBS workflow integration to build packages on push to main
Luca Boccassi [Mon, 6 Jan 2025 10:45:21 +0000 (10:45 +0000)] 
CI: add OBS workflow integration to build packages on push to main

When main is updated, packages for Arch/Debian/Ubuntu/SUSE will be built and published
on OBS:

https://download.opensuse.org/repositories/home:/bluca:/systemd/
https://build.opensuse.org/project/show/home:bluca:systemd
(cherry picked from commit 0b5f9269398d1422bb7ff3f928a4ffe67332ff63)

10 months agoRevert "mkosi: Fix opensuse build"
Daan De Meyer [Tue, 7 Jan 2025 15:25:03 +0000 (16:25 +0100)] 
Revert "mkosi: Fix opensuse build"

The commit that changes the name from README.testsuite to README.md
was never backported (and shouldn't as it would break opensuse's spec)
so revert the corresponding change in the mkosi opensuse build script.

This reverts commit 4162c331dd4fc6657d1f51c90a7a0223e9f4a30d.

10 months agostdio-bridge: fix polled fds
Jacob McNamee [Tue, 7 Jan 2025 11:29:31 +0000 (03:29 -0800)] 
stdio-bridge: fix polled fds

Poll fds associated with the bus instead of hardcoding stdin/stdout.

This is consequential under socket activation, when the provided fd
should be used instead of stdin/stdout.

(cherry picked from commit 9d1c28b2d8422df700e7d94339ac6052a6755c6c)
(cherry picked from commit 59f5a4323468befbdca2bae7907219eaf8852f9a)

10 months agofmf: Check out target branch in packit
Daan De Meyer [Tue, 7 Jan 2025 13:39:53 +0000 (14:39 +0100)] 
fmf: Check out target branch in packit

(cherry picked from commit 3c9ffd2e4b81e6bbc8cb28634432b6c9dccd661e)

10 months agopackit: Simplify configuration
Daan De Meyer [Mon, 6 Jan 2025 12:44:03 +0000 (13:44 +0100)] 
packit: Simplify configuration

(cherry picked from commit 86a6d7cc5a4798e614c50ed02c751e71f74637f9)

10 months agomkosi: Install which in build image
Daan De Meyer [Tue, 7 Jan 2025 11:23:09 +0000 (12:23 +0100)] 
mkosi: Install which in build image

Required by gdb-add-index to find gdb and not declared as a dependency
of the package.

(cherry picked from commit 414fe9629cebf1ca2dc4c38d82ad8872a5483e89)

10 months agohwdb: comment out the entry for Logitech MX Keys for Mac
Yu Watanabe [Fri, 20 Dec 2024 18:13:18 +0000 (03:13 +0900)] 
hwdb: comment out the entry for Logitech MX Keys for Mac

This effectively reverts the commit f70e5620b6ac319beac1d5ce26331bdc48d25daa,
as the entry seems to match multiple models.

Fixes #35691.

(cherry picked from commit 52a2b049476b374dea2efa22d39c5a1944125c47)

10 months agotest: answer 2nd mdadm --create question for compat with new version
Luca Boccassi [Sun, 22 Dec 2024 13:31:36 +0000 (13:31 +0000)] 
test: answer 2nd mdadm --create question for compat with new version

New version of mdadm now asks a second question, so send 'y' twice
to it in the test scripts

[    5.253483] TEST-64-UDEV-STORAGE.sh[684]: + echo y
[    5.254412] TEST-64-UDEV-STORAGE.sh[685]: + mdadm --create /dev/md/mdmirror --name mdmirror --uuid aaaaaaaa:bbbbbbbb:cccccccc:00000001 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm0 /dev/disk/by-id/scsi-0systemd_foobar_deadbeefmdadm1 -v -f --level=1 --raid-devices=2
[    5.254759] TEST-64-UDEV-STORAGE.sh[685]: To optimalize recovery speed, it is recommended to enable write-indent bitmap, do you want to enable it now? [y/N]? mdadm: Note: this array has metadata at the start and
[    5.255085] TEST-64-UDEV-STORAGE.sh[685]:     may not be suitable as a boot device.  If you plan to
[    5.255418] TEST-64-UDEV-STORAGE.sh[685]:     store '/boot' on this device please ensure that
[    5.255745] TEST-64-UDEV-STORAGE.sh[685]:     your boot-loader understands md/v1.x metadata, or use
[    5.256285] TEST-64-UDEV-STORAGE.sh[685]:     --metadata=0.90
[    5.256672] TEST-64-UDEV-STORAGE.sh[685]: mdadm: size set to 64512K
[    5.257063] TEST-64-UDEV-STORAGE.sh[685]: Continue creating array [y/N]? mdadm: create aborted.

This is backward compatible with the older version that asks just one
question

(cherry picked from commit 16406420ea449b75e70a7dced05d7b98bc0f5376)

10 months agocore/unit-serialize: fix serialization of markers
Mike Yuan [Thu, 26 Dec 2024 20:15:44 +0000 (21:15 +0100)] 
core/unit-serialize: fix serialization of markers

Follow-up for ff68472a20c208121b69ea13586f3105a219bc14

(cherry picked from commit 5ce8d7d83902e920a34488c4193d9bc4b5bb70ae)

10 months agocreds: fix use-after-free in varlink interface
Luca Boccassi [Fri, 27 Dec 2024 15:06:39 +0000 (15:06 +0000)] 
creds: fix use-after-free in varlink interface

All other usages of sd_varlink_call* do not free the json return parameter,
and it is owned by the varlink object instead. Do the same here.

TEST-54-CREDS.sh[1074]: ==1074==ERROR: AddressSanitizer: heap-use-after-free on address 0x50c00000095a at pc 0x55cf8cd18a0f bp 0x7ffd7b9d4f10 sp 0x7ffd7b9d4f08
TEST-54-CREDS.sh[1074]: READ of size 2 at 0x50c00000095a thread T0 ((sd-mkdcreds))
TEST-54-CREDS.sh[1074]:     #0 0x55cf8cd18a0e in sd_json_variant_unref /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:887:16
TEST-54-CREDS.sh[1074]:     #1 0x55cf8cd4cecb in varlink_clear_current /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:593:22
TEST-54-CREDS.sh[1074]:     #2 0x55cf8cd4975e in varlink_clear /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:614:9
TEST-54-CREDS.sh[1074]:     #3 0x55cf8cd3dc3c in varlink_destroy /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:651:9
TEST-54-CREDS.sh[1074]:     #4 0x55cf8cd3dc3c in sd_varlink_unref /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:657:1
TEST-54-CREDS.sh[1074]:     #5 0x55cf8cb47a82 in sd_varlink_unrefp /usr/src/debug/systemd/src/systemd/sd-varlink.h:279:1
TEST-54-CREDS.sh[1074]:     #6 0x55cf8cb47a82 in ipc_decrypt_credential /usr/src/debug/systemd/src/shared/creds-util.c:1660:1
TEST-54-CREDS.sh[1074]:     #7 0x55cf8caca99a in maybe_decrypt_and_write_credential /usr/src/debug/systemd/src/core/exec-credential.c:486:29
TEST-54-CREDS.sh[1074]:     #8 0x55cf8cac790b in load_credential /usr/src/debug/systemd/src/core/exec-credential.c:713:16
TEST-54-CREDS.sh[1074]:     #9 0x55cf8cac5403 in acquire_credentials /usr/src/debug/systemd/src/core/exec-credential.c:819:29
TEST-54-CREDS.sh[1074]:     #10 0x55cf8cac5403 in setup_credentials_internal /usr/src/debug/systemd/src/core/exec-credential.c:1023:13
TEST-54-CREDS.sh[1074]:     #11 0x55cf8cac42d4 in exec_setup_credentials /usr/src/debug/systemd/src/core/exec-credential.c:1168:21
TEST-54-CREDS.sh[1074]:     #12 0x55cf8ca59569 in exec_invoke /usr/src/debug/systemd/src/core/exec-invoke.c:4866:13
TEST-54-CREDS.sh[1074]:     #13 0x55cf8ca428d8 in run /usr/src/debug/systemd/src/core/executor.c:244:13
TEST-54-CREDS.sh[1074]:     #14 0x55cf8ca428d8 in main /usr/src/debug/systemd/src/core/executor.c:275:13
TEST-54-CREDS.sh[1074]:     #15 0x7f64b40110c7 in __libc_start_call_main (/lib64/libc.so.6+0x40c7) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #16 0x7f64b401118a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x418a) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #17 0x55cf8ca41cb4  (/usr/lib/systemd/systemd-executor+0x124cb4) (BuildId: 24f2b1608c3aaee3226cdd14fa2b6e6741156222)
TEST-54-CREDS.sh[1074]: 0x50c00000095a is located 26 bytes inside of 120-byte region [0x50c000000940,0x50c0000009b8)
TEST-54-CREDS.sh[1074]: freed by thread T0 ((sd-mkdcreds)) here:
TEST-54-CREDS.sh[1074]:     #0 0x7f64b48d57ea in free (/usr/lib/clang/19/lib/x86_64-redhat-linux-gnu/libclang_rt.asan.so+0xd57ea) (BuildId: c59bbd28ceb74038a60373d4a8cd4c258bcf0b4e)
TEST-54-CREDS.sh[1074]:     #1 0x55cf8cd188ab in sd_json_variant_unref /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:895:25
TEST-54-CREDS.sh[1074]:     #2 0x55cf8cb47a4c in sd_json_variant_unrefp /usr/src/debug/systemd/src/systemd/sd-json.h:98:1
TEST-54-CREDS.sh[1074]:     #3 0x55cf8cb47a4c in ipc_decrypt_credential /usr/src/debug/systemd/src/shared/creds-util.c:1660:1
TEST-54-CREDS.sh[1074]:     #4 0x55cf8caca99a in maybe_decrypt_and_write_credential /usr/src/debug/systemd/src/core/exec-credential.c:486:29
TEST-54-CREDS.sh[1074]:     #5 0x55cf8cac790b in load_credential /usr/src/debug/systemd/src/core/exec-credential.c:713:16
TEST-54-CREDS.sh[1074]:     #6 0x55cf8cac5403 in acquire_credentials /usr/src/debug/systemd/src/core/exec-credential.c:819:29
TEST-54-CREDS.sh[1074]:     #7 0x55cf8cac5403 in setup_credentials_internal /usr/src/debug/systemd/src/core/exec-credential.c:1023:13
TEST-54-CREDS.sh[1074]:     #8 0x55cf8cac42d4 in exec_setup_credentials /usr/src/debug/systemd/src/core/exec-credential.c:1168:21
TEST-54-CREDS.sh[1074]:     #9 0x55cf8ca59569 in exec_invoke /usr/src/debug/systemd/src/core/exec-invoke.c:4866:13
TEST-54-CREDS.sh[1074]:     #10 0x55cf8ca428d8 in run /usr/src/debug/systemd/src/core/executor.c:244:13
TEST-54-CREDS.sh[1074]:     #11 0x55cf8ca428d8 in main /usr/src/debug/systemd/src/core/executor.c:275:13
TEST-54-CREDS.sh[1074]:     #12 0x7f64b40110c7 in __libc_start_call_main (/lib64/libc.so.6+0x40c7) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #13 0x7f64b401118a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x418a) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #14 0x55cf8ca41cb4  (/usr/lib/systemd/systemd-executor+0x124cb4) (BuildId: 24f2b1608c3aaee3226cdd14fa2b6e6741156222)
TEST-54-CREDS.sh[1074]: previously allocated by thread T0 ((sd-mkdcreds)) here:
TEST-54-CREDS.sh[1074]:     #0 0x7f64b48d5a83 in malloc (/usr/lib/clang/19/lib/x86_64-redhat-linux-gnu/libclang_rt.asan.so+0xd5a83) (BuildId: c59bbd28ceb74038a60373d4a8cd4c258bcf0b4e)
TEST-54-CREDS.sh[1074]:     #1 0x55cf8cd16bb7 in malloc_multiply /usr/src/debug/systemd/src/basic/alloc-util.h:119:16
TEST-54-CREDS.sh[1074]:     #2 0x55cf8cd16bb7 in sd_json_variant_new_object /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:737:13
TEST-54-CREDS.sh[1074]:     #3 0x55cf8cd32e58 in json_parse_internal /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:3161:29
TEST-54-CREDS.sh[1074]:     #4 0x55cf8cd37326 in sd_json_parse_with_source /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:3408:16
TEST-54-CREDS.sh[1074]:     #5 0x55cf8cd37326 in sd_json_parse /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:3437:16
TEST-54-CREDS.sh[1074]:     #6 0x55cf8cd3f753 in varlink_parse_message /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:962:13
TEST-54-CREDS.sh[1074]:     #7 0x55cf8cd3f753 in sd_varlink_process /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:1466:13
TEST-54-CREDS.sh[1074]:     #8 0x55cf8cd4c0a9 in sd_varlink_call_full /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:2160:21
TEST-54-CREDS.sh[1074]:     #9 0x55cf8cd4d617 in sd_varlink_callb_ap /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:2237:16
TEST-54-CREDS.sh[1074]:     #10 0x55cf8cd4da3c in sd_varlink_callb /usr/src/debug/systemd/src/libsystemd/sd-varlink/sd-varlink.c:2251:13
TEST-54-CREDS.sh[1074]:     #11 0x55cf8cb47686 in ipc_decrypt_credential /usr/src/debug/systemd/src/shared/creds-util.c:1623:13
TEST-54-CREDS.sh[1074]:     #12 0x55cf8caca99a in maybe_decrypt_and_write_credential /usr/src/debug/systemd/src/core/exec-credential.c:486:29
TEST-54-CREDS.sh[1074]:     #13 0x55cf8cac790b in load_credential /usr/src/debug/systemd/src/core/exec-credential.c:713:16
TEST-54-CREDS.sh[1074]:     #14 0x55cf8cac5403 in acquire_credentials /usr/src/debug/systemd/src/core/exec-credential.c:819:29
TEST-54-CREDS.sh[1074]:     #15 0x55cf8cac5403 in setup_credentials_internal /usr/src/debug/systemd/src/core/exec-credential.c:1023:13
TEST-54-CREDS.sh[1074]:     #16 0x55cf8cac42d4 in exec_setup_credentials /usr/src/debug/systemd/src/core/exec-credential.c:1168:21
TEST-54-CREDS.sh[1074]:     #17 0x55cf8ca59569 in exec_invoke /usr/src/debug/systemd/src/core/exec-invoke.c:4866:13
TEST-54-CREDS.sh[1074]:     #18 0x55cf8ca428d8 in run /usr/src/debug/systemd/src/core/executor.c:244:13
TEST-54-CREDS.sh[1074]:     #19 0x55cf8ca428d8 in main /usr/src/debug/systemd/src/core/executor.c:275:13
TEST-54-CREDS.sh[1074]:     #20 0x7f64b40110c7 in __libc_start_call_main (/lib64/libc.so.6+0x40c7) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #21 0x7f64b401118a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x418a) (BuildId: 159846287d47eef88f2a478f59803f6e8fc81d05)
TEST-54-CREDS.sh[1074]:     #22 0x55cf8ca41cb4  (/usr/lib/systemd/systemd-executor+0x124cb4) (BuildId: 24f2b1608c3aaee3226cdd14fa2b6e6741156222)
TEST-54-CREDS.sh[1074]: SUMMARY: AddressSanitizer: heap-use-after-free /usr/src/debug/systemd/src/libsystemd/sd-json/sd-json.c:887:16 in sd_json_variant_unref
TEST-54-CREDS.sh[1074]: Shadow bytes around the buggy address:
TEST-54-CREDS.sh[1074]:   0x50c000000680: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000700: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
TEST-54-CREDS.sh[1074]:   0x50c000000780: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
TEST-54-CREDS.sh[1074]:   0x50c000000800: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000880: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
TEST-54-CREDS.sh[1074]: =>0x50c000000900: fa fa fa fa fa fa fa fa fd fd fd[fd]fd fd fd fd
TEST-54-CREDS.sh[1074]:   0x50c000000980: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000a80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000b00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]:   0x50c000000b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
TEST-54-CREDS.sh[1074]: Shadow byte legend (one shadow byte represents 8 application bytes):
TEST-54-CREDS.sh[1074]:   Addressable:           00
TEST-54-CREDS.sh[1074]:   Partially addressable: 01 02 03 04 05 06 07
TEST-54-CREDS.sh[1074]:   Heap left redzone:       fa
TEST-54-CREDS.sh[1074]:   Freed heap region:       fd
TEST-54-CREDS.sh[1074]:   Stack left redzone:      f1
TEST-54-CREDS.sh[1074]:   Stack mid redzone:       f2
TEST-54-CREDS.sh[1074]:   Stack right redzone:     f3
TEST-54-CREDS.sh[1074]:   Stack after return:      f5
TEST-54-CREDS.sh[1074]:   Stack use after scope:   f8
TEST-54-CREDS.sh[1074]:   Global redzone:          f9
TEST-54-CREDS.sh[1074]:   Global init order:       f6
TEST-54-CREDS.sh[1074]:   Poisoned by user:        f7
TEST-54-CREDS.sh[1074]:   Container overflow:      fc
TEST-54-CREDS.sh[1074]:   Array cookie:            ac
TEST-54-CREDS.sh[1074]:   Intra object redzone:    bb
TEST-54-CREDS.sh[1074]:   ASan internal:           fe
TEST-54-CREDS.sh[1074]:   Left alloca redzone:     ca
TEST-54-CREDS.sh[1074]:   Right alloca redzone:    cb

Follow-up for 2c3cbc5c018e05b3a3e5ec6c6a2da6f3c6c3fb09

(cherry picked from commit 842a674d4f7fb69af28e67f447c1250383e50f41)

10 months agomachine: GC machine when no leader PID is set
Yu Watanabe [Sat, 28 Dec 2024 02:38:24 +0000 (11:38 +0900)] 
machine: GC machine when no leader PID is set

After d8854ff1aca4434db0d7d6dcaf9fcf2f38105fb4, if a serialized
leader PID of a machine is already dead when deserialized, then the
leader PID and PIDFD are unset for the machine, and subsequent
machine_start() -> machine_watch_pidfd() will trigger an assertion.
This makes a Machine object without leader PID GCed.

Fixes a bug introduced by the combination of
d8854ff1aca4434db0d7d6dcaf9fcf2f38105fb4 (v255) and
1762c2c045d3a78d3cad54c6b1e5ee9624b32b00 (v257).

Fixes #35602.

(cherry picked from commit 51a0a3b0494d01c1622f6d0c3e2c31e01c18612f)

10 months agolocale-setup: do not load locale from environemnt when /etc/locale.conf is unchanged
Yu Watanabe [Sat, 28 Dec 2024 06:07:31 +0000 (15:07 +0900)] 
locale-setup: do not load locale from environemnt when /etc/locale.conf is unchanged

Previously, when /etc/locale.conf is unchanged, locales were loaded from
possibly outdated environment variable.

Fixes a bug introduced by 018befcff6b51f8a50ca232e1984d34526037241 (v253).
Fixes #35717.

(cherry picked from commit 80797bbb919b3ccde4e51b349f3ca70c1157053e)

10 months agoshared/hibernate-util: handle the case where no swap has available backing dev
Mike Yuan [Thu, 2 Jan 2025 03:17:47 +0000 (04:17 +0100)] 
shared/hibernate-util: handle the case where no swap has available backing dev

This also makes find_suitable_hibernation_device() report
more accurate error (ENOSPC -> ESTALE) if there's
no swap space on the system at all but resume= is set.

Fixes #35798
Replaces #35801

(cherry picked from commit bd3d361580715c7a6204c74df9185cc81d67f0c2)

10 months agoshared/hibernate-util: don't attempt to fiemap fd if no backing dev available
Mike Yuan [Thu, 2 Jan 2025 03:13:23 +0000 (04:13 +0100)] 
shared/hibernate-util: don't attempt to fiemap fd if no backing dev available

Prompted by #35798

Co-authored-by: Yu Watanabe <watanabe.yu+github@gmail.com>
(cherry picked from commit 6d3b2273b1e14d79548a018674ad6e5a5b8b8009)

10 months agoresolved: stop mdns/lnrr when config changes to disabled on reload
Luca Boccassi [Thu, 2 Jan 2025 17:30:21 +0000 (17:30 +0000)] 
resolved: stop mdns/lnrr when config changes to disabled on reload

Currently on reload mdns/lnrr are enabled if they were disabled,
but not viceversa. Fix it.

Follow-up for 14a52176798bc2d013297b503ac6fa49a64e2725

(cherry picked from commit 2976730a4d34749bfb7a88da341464f1834ab1c6)

10 months agosd-device: fix validation for devices under /sys/firmware/ in sd_device_new_from_subs...
Yu Watanabe [Sat, 4 Jan 2025 18:52:05 +0000 (03:52 +0900)] 
sd-device: fix validation for devices under /sys/firmware/ in sd_device_new_from_subsystem_sysname()

Devices under /sys/firmware/ do not have subsystems. Hence, the
validation in sd_device_new_from_subsystem_sysname() ->
device_new_from_path_join() always failed.

Fixes a bug introduced by cd7c71154cd62d3f50c07ce387edd9c20aebd7bc (v257).
Fixes #35861.

(cherry picked from commit 3328d1e1816f408e6516c35991a89a8d21fd60b4)

10 months agosd-device: add missing debugging log
Yu Watanabe [Sat, 4 Jan 2025 18:09:29 +0000 (03:09 +0900)] 
sd-device: add missing debugging log

It was unexpectedly dropped by 660087dc9c4a5c610da99e7b6b1772e371eb0a80.

(cherry picked from commit 7e5238625ed4a879c2fe8ff7e457021d174bf083)

10 months agorepart: Use streq_ptr()
Daan De Meyer [Mon, 6 Jan 2025 22:02:30 +0000 (23:02 +0100)] 
repart: Use streq_ptr()

p->format is not guaranteed to be initialized.

(cherry picked from commit ffcdaec632d8b96b63499054ff3492b03b33e233)

10 months agocore: fix assert when AddDependencyUnitFiles is called with invalid parameter
Luca Boccassi [Mon, 6 Jan 2025 18:16:29 +0000 (18:16 +0000)] 
core: fix assert when AddDependencyUnitFiles is called with invalid parameter

unit_file_add_dependency() asserts, so check before calling it that the
type is expected, or return EINVAL to the caller.

root@localhost:~# busctl call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager AddDependencyUnitFiles "asssbb" 0 uwhatm8 After 1 1

Broadcast message from systemd-journald@localhost (Mon 2025-01-06 18:12:14 UTC):

systemd[1]: Caught <ABRT>, from our own process.

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

(cherry picked from commit d87dc74e8f1a30d72a0f202e411400bab34ab55a)

10 months agofmf: Support being used downstream in dist-git tests
Daan De Meyer [Mon, 6 Jan 2025 15:30:23 +0000 (16:30 +0100)] 
fmf: Support being used downstream in dist-git tests

We can use our upstream fmf definitions to run downstream tests in
the Fedora systemd dist-git repository
(https://src.fedoraproject.org/rpms/systemd). To have access to the
dist-git sources when running the tests, we enable dist-git-source: true
downstream which makes the sources available in $TMT_SOURCE_DIR so
let's make sure we use those sources if they're available.

(cherry picked from commit 0eb7e29dfb388f746797675cef1ebd7bc3568b6e)

10 months agofmf: Insist on mkosi sha being available
Daan De Meyer [Mon, 6 Jan 2025 15:28:39 +0000 (16:28 +0100)] 
fmf: Insist on mkosi sha being available

Let's assume the workflow file containing the mkosi always being
available.

Also fix the detection while we're at it by not leaving the systemd
directory.

(cherry picked from commit 9e76e9c9dc211440e79a7e27600593169597cc41)

10 months agoci: Rename qemu variable to vm
Daan De Meyer [Mon, 6 Jan 2025 11:08:33 +0000 (12:08 +0100)] 
ci: Rename qemu variable to vm

(cherry picked from commit c5981510e9744b9646088717aeef1ea71f74b1a6)

10 months agomkosi: Migrate more deprecated options
Daan De Meyer [Mon, 6 Jan 2025 11:07:53 +0000 (12:07 +0100)] 
mkosi: Migrate more deprecated options

(cherry picked from commit 28baef47a3098bd82b27c0a629df6c5f885693e7)

10 months agomkosi: replace deprecated settings and command with new ones
Yu Watanabe [Mon, 6 Jan 2025 07:30:26 +0000 (16:30 +0900)] 
mkosi: replace deprecated settings and command with new ones

Follow-up for c008b703701e676a88e16de4c867b9fc4818070d.

These settings and command were deprecated by the following commit.
https://github.com/systemd/mkosi/commit/ebcd2efa03af5c04de91434634f2e4a956f7e53c

(cherry picked from commit d5cdcba928823faf5ddcca267e3866ab5d5fc729)

10 months agopackit: Move fmf metadata into upstream
Daan De Meyer [Fri, 20 Dec 2024 14:34:13 +0000 (15:34 +0100)] 
packit: Move fmf metadata into upstream

This moves https://src.fedoraproject.org/tests/systemd into upstream
so it's one less moving piece that we need to remember. While we're at
it, do various cleanups as well:

- Remove non-packit logic
- Set NO_BUILD in mkosi.local.conf as it's not picked up from the
  process environment
- Don't set unused environment variables
- Remove workdir logic as we run in an ephemeral VM already
- Drop --verbose from meson test to reduce noise
  from passed tests
- Use mkosi sandbox and drop duplicated deps from metadata file
- Stop running the unit tests as they already run as part of the rpm
  build and as part of the integration tests.
- Various style fixes

(cherry picked from commit b0b88f18b3237704d1f6d5b3dcb533367816ce23)

10 months agomkosi: Make path exclude more generic
Daan De Meyer [Sun, 5 Jan 2025 22:19:44 +0000 (23:19 +0100)] 
mkosi: Make path exclude more generic

The systemd rpms we try to install in packit have /usr/bin/bash and
/usr/bin/python3 as dependencies which breaks dnf5 because mkosi
doesn't download filelists metadata and
https://bugzilla.redhat.com/show_bug.cgi?id=2263771 is still not fixed
almost a year after being reported.

(cherry picked from commit 8a9b989cba75810406b0c881bcabe03c27fa47e5)

10 months agomkosi: Update to latest
Daan De Meyer [Fri, 3 Jan 2025 22:25:23 +0000 (23:25 +0100)] 
mkosi: Update to latest

(cherry picked from commit c008b703701e676a88e16de4c867b9fc4818070d)

10 months agomkosi: Warn on unpackaged files in the debian package build
Daan De Meyer [Fri, 3 Jan 2025 10:42:47 +0000 (11:42 +0100)] 
mkosi: Warn on unpackaged files in the debian package build

(cherry picked from commit e965430f57834d641b0b1327617622c20aa23b70)

10 months agomkosi: Handle directories in debian/not-installed correctly
Daan De Meyer [Fri, 3 Jan 2025 09:20:45 +0000 (10:20 +0100)] 
mkosi: Handle directories in debian/not-installed correctly

If a directory is specified without a glob pattern, we have to exclude
all files in that directory, so add a recursive glob to every directory
and enable the bash globstar feature when globbing to '**/*' matches all
files and directories beneath the given directory.

(cherry picked from commit d304b95beb76fd62ea249357df526fb211426edc)

10 months agomkosi: Add docbook tools
Daan De Meyer [Thu, 2 Jan 2025 14:48:54 +0000 (15:48 +0100)] 
mkosi: Add docbook tools

(cherry picked from commit fd3ee47d8d1cac09acf034cdbe53071ee6fdde74)

10 months agotest: update README's Ubuntu CI section for mkosi changes
Luca Boccassi [Thu, 2 Jan 2025 16:21:42 +0000 (16:21 +0000)] 
test: update README's Ubuntu CI section for mkosi changes

(cherry picked from commit 01829580471eb1958bc5c43caa871b243edb1055)

10 months agodocs: Use mkosi sandbox in test documentation as well
Daan De Meyer [Thu, 2 Jan 2025 15:17:53 +0000 (16:17 +0100)] 
docs: Use mkosi sandbox in test documentation as well

Same change as in HACKING.md, but for running the integration tests.

(cherry picked from commit 8a652636503ee99dd484e2ae051cc1f1bdfc18ab)

10 months agomkosi: Allow disabling vcs-tag via environment variable
Daan De Meyer [Thu, 2 Jan 2025 12:11:48 +0000 (13:11 +0100)] 
mkosi: Allow disabling vcs-tag via environment variable

(cherry picked from commit 76d80cc34331b0cefd354ea9de70e9bbb46550a0)

10 months agomkosi: switch to github mirror of openSUSE sources from build.opensuse.org
Antonio Alvarez Feijoo [Mon, 30 Dec 2024 16:39:16 +0000 (17:39 +0100)] 
mkosi: switch to github mirror of openSUSE sources from build.opensuse.org

The current src.opensuse.org is very unstable and commit hashes are reset (or
even removed) every now and then. While the official repo is not fixed, let's
move to a more stable source, the github mirror of code.opensuse.org, maintained
since 2019.

(cherry picked from commit 07638ce2a46c99300e21d7b54e9404fdce488d53)

10 months agomkosi: add libopenssl devel package to openSUSE tools tree
Antonio Alvarez Feijoo [Mon, 30 Dec 2024 16:38:36 +0000 (17:38 +0100)] 
mkosi: add libopenssl devel package to openSUSE tools tree

Otherwise, the build fails with:

```
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /mnt/work/src/systemd/upstream-fork/main/build-mkosi
ninja: Entering directory `/mnt/work/src/systemd/upstream-fork/main/build-mkosi'
[463/2561] Compiling C object src/shared/libsystemd-shared-258.a.p/openssl-util.c.o
FAILED: src/shared/libsystemd-shared-258.a.p/openssl-util.c.o
cc -Isrc/shared/libsystemd-shared-258.a.p -Isrc/shared -I../src/shared -Isrc/basic -I../src/basic -Isrc/fundamental -I../src/fundamental -Isrc/systemd -I../src/systemd -I. -I.. -I../src/libsystemd/sd-bus -I../src/libsystemd/sd-device -I../src/libsystemd/sd-event -I../src/libsystemd/sd-hwdb -I../src/libsystemd/sd-id128 -I../src/libsystemd/sd-journal -I../src/libsystemd/sd-json -I../src/libsystemd/sd-netlink -I../src/libsystemd/sd-network -I../src/libsystemd/sd-path -I../src/libsystemd/sd-resolve -I../src/libsystemd/sd-varlink -I/usr/include/blkid -I/usr/include/libmount -I/usr/include/p11-kit-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -std=gnu11 -O0 -g -Wno-missing-field-initializers -Wno-unused-parameter -Wno-nonnull-compare -Warray-bounds -Warray-bounds=2 -Wdate-time -Wendif-labels -Werror=format=2 -Werror=format-signedness -Werror=implicit-function-declaration -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Werror=missing-declarations -Werror=missing-prototypes -Werror=overflow -Werror=override-init -Werror=return-type -Werror=shift-count-overflow -Werror=shift-overflow=2 -Werror=strict-flex-arrays -Werror=undef -Wfloat-equal -Wimplicit-fallthrough=5 -Winit-self -Wlogical-op -Wmissing-include-dirs -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-aliasing=2 -Wstrict-prototypes -Wsuggest-attribute=noreturn -Wunused-function -Wwrite-strings -Wzero-length-bounds -fdiagnostics-show-option -fno-common -fstack-protector -fstack-protector-strong -fstrict-flex-arrays=3 --param=ssp-buffer-size=4 -Wno-unused-result -Werror=shadow -fPIC -fno-strict-aliasing -fstrict-flex-arrays=1 -fvisibility=hidden -fno-omit-frame-pointer -include config.h -pthread -fvisibility=default -MD -MQ src/shared/libsystemd-shared-258.a.p/openssl-util.c.o -MF src/shared/libsystemd-shared-258.a.p/openssl-util.c.o.d -o src/shared/libsystemd-shared-258.a.p/openssl-util.c.o -c ../src/shared/openssl-util.c
../src/shared/openssl-util.c: In function ‘openssl_ask_password_ui_read’:
../src/shared/openssl-util.c:1395:65: error: implicit declaration of function ‘UI_method_get_ex_data’; did you mean ‘UI_method_get_reader’? [-Wimplicit-function-declaration]
 1395 |                 AskPasswordRequest *req = (AskPasswordRequest*) UI_method_get_ex_data(UI_get_method(ui), 0);
      |                                                                 ^~~~~~~~~~~~~~~~~~~~~
      |                                                                 UI_method_get_reader
../src/shared/openssl-util.c:1395:65: warning: nested extern declaration of ‘UI_method_get_ex_data’ [-Wnested-externs]
../src/shared/openssl-util.c:1395:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 1395 |                 AskPasswordRequest *req = (AskPasswordRequest*) UI_method_get_ex_data(UI_get_method(ui), 0);
      |                                           ^
../src/shared/openssl-util.c: In function ‘openssl_ask_password_ui_new’:
../src/shared/openssl-util.c:1479:13: error: implicit declaration of function ‘UI_method_set_ex_data’; did you mean ‘UI_method_set_reader’? [-Wimplicit-function-declaration]
 1479 |         if (UI_method_set_ex_data(ui->method, 0, &ui->request) == 0)
      |             ^~~~~~~~~~~~~~~~~~~~~
      |             UI_method_set_reader
../src/shared/openssl-util.c:1479:13: warning: nested extern declaration of ‘UI_method_set_ex_data’ [-Wnested-externs]
[480/2561] Compiling C object src/shared/libsystemd-shared-258.a.p/pkcs11-util.c.o
ninja: build stopped: subcommand failed.
```

(cherry picked from commit 8a6ad7c8376b5dab1d3502a39cead9c63152293d)

10 months agomkosi: update openSUSE commit reference
Antonio Alvarez Feijoo [Mon, 30 Dec 2024 10:00:07 +0000 (11:00 +0100)] 
mkosi: update openSUSE commit reference

Force-pushed as usual, now HEAD is v257.1.

(cherry picked from commit 37c2be73e7238a99bc114f85c7af5c4702f15046)

10 months agomkosi: update opensuse spec repo commit
Luca Boccassi [Thu, 26 Dec 2024 12:08:34 +0000 (12:08 +0000)] 
mkosi: update opensuse spec repo commit

(cherry picked from commit 4db0252c7fd53dc5388db458ad93ce7ef433e704)

10 months agodocs: Explicitly mention ~/.local/bin in section on installing mkosi
Daan De Meyer [Mon, 23 Dec 2024 20:30:32 +0000 (21:30 +0100)] 
docs: Explicitly mention ~/.local/bin in section on installing mkosi

(cherry picked from commit 54b4ec887066b12fe97ac28d7ed5108a23f262de)

10 months agodocs: Use meson compile instead of ninja
Daan De Meyer [Tue, 24 Dec 2024 08:53:53 +0000 (09:53 +0100)] 
docs: Use meson compile instead of ninja

"ninja -C build mkosi" doesn't actually work and fails because ninja
thinks the mkosi target does not exist. "meson compile -C build mkosi"
dpes work so let's use that instead.

Fixes #35741

(cherry picked from commit ece81f339ff41113876bf7a9a2c1ad317c2eb258)

10 months agomkosi: Fix authselect systemd-homed feature name
Daan De Meyer [Sat, 21 Dec 2024 18:10:42 +0000 (19:10 +0100)] 
mkosi: Fix authselect systemd-homed feature name

The feature name is with-systemd-homed, not with-homed.

(cherry picked from commit 5495b11360d649dc8810d59b096231ba596e9436)

10 months agodocs: Simplify hacking documentation
Daan De Meyer [Thu, 19 Dec 2024 10:45:01 +0000 (11:45 +0100)] 
docs: Simplify hacking documentation

Let's use "mkosi sandbox" in the docs so that users can build systemd
without having to install anything except mkosi. Using mkosi sandbox
will use tools and dependencies from the tools tree which is also used
in CI and thus has a higher chance of working from the first try compared
to whatever tools might be installed on the host system of a new contributor.

(cherry picked from commit 34b5a27b0bfd1b0b35bf67c70d1f8bf5c6795b7d)

10 months agomkosi.clangd: Fail on command errors
Daan De Meyer [Thu, 19 Dec 2024 14:05:51 +0000 (15:05 +0100)] 
mkosi.clangd: Fail on command errors

(cherry picked from commit ba3f148307e551d1be3e92383c8d37a9cc5b7a95)

10 months agomkosi.clangd: Don't pass --host if we're not using flatpak-spawn
Daan De Meyer [Thu, 19 Dec 2024 14:05:33 +0000 (15:05 +0100)] 
mkosi.clangd: Don't pass --host if we're not using flatpak-spawn

(cherry picked from commit b133f57544cb6cce244bb8566fbacc952db76d73)

10 months agomkosi: Use build/ as extra search path by default
Daan De Meyer [Thu, 19 Dec 2024 10:43:01 +0000 (11:43 +0100)] 
mkosi: Use build/ as extra search path by default

Building systemd with mkosi generally requires a very recent version
of systemd which might not be installed on the host. Let's configure
mkosi to look for extra executables in the build/ directory by default
so that we prefer systemd executables from the build directory over those
on the host as those on the host are likely to be too old.

(cherry picked from commit 8c5b4df5435ff9e49421ef8db0ca6de06c856b04)

10 months agomkosi: Use tools tree by default
Daan De Meyer [Thu, 19 Dec 2024 10:41:40 +0000 (11:41 +0100)] 
mkosi: Use tools tree by default

Let's enable usage of a tools tree by default to simplify the setup
for new contributors and save them from having to install or upgrade
a bunch of extra tools to get mkosi working as expected.

(cherry picked from commit 1995084a9e01b53cf012a54fe69e35016c235151)

10 months agomkosi: Enable EPEL for CentOS Stream tools tree
Daan De Meyer [Thu, 19 Dec 2024 15:49:59 +0000 (16:49 +0100)] 
mkosi: Enable EPEL for CentOS Stream tools tree

We need packages from EPEL to be able to build CentOS Stream images
with a CentOS Stream tools tree so enable it. This is broken on CentOS
Stream 10 but given using a CentOS Stream tools tree is broken without
EPEL as well, we might as well enable it and just wait until the packages
are added to EPEL 10.

(cherry picked from commit ac1a711d9a237eea36b053d43c0c35af7ac40b1f)

10 months agomkosi: Add libz1 to opensuse tools tree
Daan De Meyer [Thu, 19 Dec 2024 13:43:48 +0000 (14:43 +0100)] 
mkosi: Add libz1 to opensuse tools tree

Without meson fails to configure properly.

(cherry picked from commit d4dda34854c3bcb44ab5929ad32d0793e4debb9f)

10 months agomkosi: Add gdb to tools tree
Daan De Meyer [Thu, 19 Dec 2024 10:32:51 +0000 (11:32 +0100)] 
mkosi: Add gdb to tools tree

(cherry picked from commit 7337f4b1972a099714d596a5d0e7e26f7f2dab48)

10 months agomkosi: Update to latest
Daan De Meyer [Thu, 19 Dec 2024 12:54:13 +0000 (13:54 +0100)] 
mkosi: Update to latest

(cherry picked from commit 1dd345b00d3c0e29abd661094f1cc58173a266e0)

10 months agomkosi: move config options
Matteo Croce [Thu, 19 Dec 2024 18:51:42 +0000 (19:51 +0100)] 
mkosi: move config options

Move some config option in the right section, fixes the following warning:
```
mkosi.conf: Setting Credentials should be configured in [Runtime], not [Host].
mkosi.conf: Setting RuntimeBuildSources should be configured in [Runtime], not [Host].
mkosi.conf: Setting RuntimeScratch should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuSmp should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuSwtpm should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuVsock should be configured in [Runtime], not [Host].
mkosi.conf: Setting QemuKvm should be configured in [Runtime], not [Host].
```

(cherry picked from commit 77d4a263c14ffbb6133382bc18319b6a54a8eaae)

11 months agov257 batch up to b5ea69f5acc4ae0e8d31b236072f75b233dae6e8 (#35682) v257.1
Adrian Vovk [Thu, 19 Dec 2024 21:25:48 +0000 (22:25 +0100)] 
v257 batch up to b5ea69f5acc4ae0e8d31b236072f75b233dae6e8 (#35682)

This includes a revert of
https://github.com/systemd/systemd/commit/2736295ddb78a457796f24805e7b98c3f5304848
as that was identified as the first commit that introduced the boot
regression https://github.com/systemd/systemd/issues/35499

11 months agoRevert "terminal-util: unify code that resets /dev/console in common helper" 35682/head
Luca Boccassi [Thu, 19 Dec 2024 12:26:36 +0000 (12:26 +0000)] 
Revert "terminal-util: unify code that resets /dev/console in common helper"

This reverts commit 2736295ddb78a457796f24805e7b98c3f5304848.

11 months agosemaphore: switch debian/ubuntu to ci/v257-stable branch
Luca Boccassi [Thu, 19 Dec 2024 11:46:50 +0000 (11:46 +0000)] 
semaphore: switch debian/ubuntu to ci/v257-stable branch

Packaging has diverged from main due to new files

11 months agomkosi: switch debian/ubuntu to ci/v257-stable branch
Luca Boccassi [Thu, 19 Dec 2024 11:45:43 +0000 (11:45 +0000)] 
mkosi: switch debian/ubuntu to ci/v257-stable branch

Packaging has diverged from main due to new files

11 months agoukify: Fix regression in --no-sign-kernel flag
Thomas Hebb [Wed, 18 Dec 2024 16:08:17 +0000 (11:08 -0500)] 
ukify: Fix regression in --no-sign-kernel flag

The man page says that --sign-kernel and --no-sign-kernel "override the
detection of whether to sign the Linux binary", so we should only
autodetect if neither are specified. But as of commit 02eabaffe98c
("ukify: Add a unified interface for signing tools"), we autodetect even
when --no-sign-kernel is passed, which makes the flag useless.

The sign_kernel option is parsed using argparse.BooleanOptionalAction,
which sets it to either True, False, or None. commit 02eabaffe98c
replaced `sign_kernel is None` with `not sign_kernel`. These are not the
same in Python, as the latter accepts False as well as None.

Restore the original check and fix type annotations accordingly.

Fixes: 02eabaffe98c ("ukify: Add a unified interface for signing tools")
(cherry picked from commit 32c3e1379dce563a7e686c99045549ac74cce142)

11 months agoman: Document generator sandbox environment
Daan De Meyer [Wed, 18 Dec 2024 11:32:59 +0000 (12:32 +0100)] 
man: Document generator sandbox environment

(cherry picked from commit a48803fd8464e56747f0e145af61bd746351c7d6)

11 months agoresolved: if one transaction completes, expect other transactions within candidate...
Morten Hauke Solvang [Thu, 12 Dec 2024 13:26:31 +0000 (14:26 +0100)] 
resolved: if one transaction completes, expect other transactions within candidate to succeed quickly

Fixes #22575, as suggested by poettering in #35514.

Intended as a workaround for some buggy routers, which refuse to send empty
replies. If systemd-resolved starts two DnsTransactions, one for A and one
for AAAA, and the domain in question has no AAAA entry, then the server will
send a reply for A and no reply for AAAA. Correct behavior for the server would
be to send an empty reply for AAAA.

systemd-resolved would previously keep retrying the AAAA transaction, and
eventually timeout the whole query, returning an error to the caller.

Now, if the server replies to one query and not another, we cut short the
timeout and return the partial result. Returning the partial result allows
the rest of the system to keep working. It matches how e.g. glibc libnss_dns
behaves.

(cherry picked from commit 0da73fab56506ff1e4f8e59c167d27961f0fbf33)

11 months agotpm2-util: Also retry unsealing after policy_pcr returns PCR_CHANGED
Fabian Vogt [Mon, 16 Dec 2024 18:08:13 +0000 (19:08 +0100)] 
tpm2-util: Also retry unsealing after policy_pcr returns PCR_CHANGED

It's not just Esys_Unseal that may fail due to PCR changes during the
session, but also Esys_PolicyPCR. Perform a retry in that case as well.

Fixes #35490

(cherry picked from commit e61032bf47e6a7e572643a0060c6dd610635c854)

11 months agomkosi: Fix tools image package name
Michal Koutný [Wed, 18 Dec 2024 09:36:55 +0000 (10:36 +0100)] 
mkosi: Fix tools image package name

(cherry picked from commit 4c9f242a54ced16897857a80867758557829f0c3)

11 months agotest: skip TEST-69-SHUTDOWN on ubuntu too
Nick Rosbrook [Tue, 17 Dec 2024 16:10:42 +0000 (11:10 -0500)] 
test: skip TEST-69-SHUTDOWN on ubuntu too

(cherry picked from commit 96c4d9d94d06c6c0a8b68be376505f8d8b5eba2b)

11 months agosystemctl-edit: ignore ENOENT from unit_is_masked()
Yu Watanabe [Mon, 16 Dec 2024 03:37:17 +0000 (12:37 +0900)] 
systemctl-edit: ignore ENOENT from unit_is_masked()

If a specified unit does not exist, then it is definitely not masked.

Fixes #35632.

(cherry picked from commit b58b00e4c33474505009c8118d6cfdf29a2c6cb1)

11 months agonetworkd: show wireguard private key read error number
Lennart Poettering [Mon, 16 Dec 2024 16:19:59 +0000 (17:19 +0100)] 
networkd: show wireguard private key read error number

Noticed while looking at #35641

(cherry picked from commit 0543b02cf8211353c0bb1065e09614f551944a41)

11 months agomkosi: temporarily disable panic_on_warn
Luca Boccassi [Mon, 16 Dec 2024 17:13:08 +0000 (17:13 +0000)] 
mkosi: temporarily disable panic_on_warn

Due to a BTRFS issue in kernel 6.12 (and backported in Ubuntu to 6.8)
there's a warning triggered by some tests, and it then causes a panic.

The BTRFS issue has a patch but it is not available in any distro yet,
so disable panic_on_warn until it reaches Arch and Ubuntu Noble. Bugs
have been filed.

(cherry picked from commit 930d65ccca8193a8cb635099c55852b677f5d58a)

11 months agotest/README: Environment= setting for mkosi should be in [Build] section
Yu Watanabe [Sun, 15 Dec 2024 17:02:30 +0000 (02:02 +0900)] 
test/README: Environment= setting for mkosi should be in [Build] section

Otherwise, we get the following warning:

mkosi.local.conf: Setting Environment should be configured in [Build], not [Content].

(cherry picked from commit 78ef3959474a760679e50eb57b52563cb6f9b66d)

11 months agoTEST-35-LOGIN: check only tty session
Yu Watanabe [Sun, 15 Dec 2024 08:42:10 +0000 (17:42 +0900)] 
TEST-35-LOGIN: check only tty session

For some reasons, another session logind-test-user may be started.
===
Dec 13 07:04:16 systemd-logind[2140]: Got message type=method_call ... member=CreateSessionWithPIDFD ...
(snip)
Dec 13 07:04:16 systemd-logind[2140]: New session 15 of user logind-test-user.
Dec 13 07:04:16 systemd-logind[2140]: VT changed to 2
Dec 13 07:04:16 systemd-logind[2140]: rfkill: Found udev node /dev/rfkill for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: udmabuf: Found udev node /dev/udmabuf for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Found static node /dev/snd/timer for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Found static node /dev/snd/seq for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/snd/timer for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/rfkill for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/udmabuf for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/snd/seq for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd[1]: user-4712.slice: Changed dead -> active
Dec 13 07:04:16 systemd[1]: user-4712.slice: Job 5951 user-4712.slice/start finished, result=done
Dec 13 07:04:16 systemd[1]: Created slice user-4712.slice.
Dec 13 07:04:16 systemd-logind[2140]: Electing new display for user logind-test-user
Dec 13 07:04:16 systemd-logind[2140]: Choosing session 15 in preference to -
(snip)
Dec 13 07:04:16 systemd-logind[2140]: Got message type=method_call ... member=CreateSessionWithPIDFD ...
(snip)
Dec 13 07:04:16 systemd-logind[2140]: New session 16 of user logind-test-user.
Dec 13 07:04:16 systemd-logind[2140]: Electing new display for user logind-test-user
Dec 13 07:04:16 systemd-logind[2140]: Ignoring session 16
===
Let's track only session for the user with tty, which we explicitly created.

Fixes #35597.

(cherry picked from commit 26f65dc0c76f59eb3896014346652885c493ae71)

11 months agonetwork: don't warn with no NSID assigned
Ronan Pigott [Sat, 14 Dec 2024 21:39:26 +0000 (14:39 -0700)] 
network: don't warn with no NSID assigned

This is nothing interesting to warn about. Also use the symbolic
constant name when testing for this condition.

(cherry picked from commit e803e95760be87588533f9affd76db6ad0b5fac8)

11 months agotest-time-util: fix truncation of usec to sec
Yu Watanabe [Sat, 14 Dec 2024 07:49:54 +0000 (16:49 +0900)] 
test-time-util: fix truncation of usec to sec

Also
- use ASSERT_XYZ() macros,
- log tzname[] on failure.

(cherry picked from commit 3f1d499964abb6a4c0141d7ea8f852829880adff)

11 months agomkosi: fix section for WithNetwork=
Luca Boccassi [Sat, 14 Dec 2024 10:57:34 +0000 (10:57 +0000)] 
mkosi: fix section for WithNetwork=

/tmp/autopkgtest.L6NPL0/build.doZ/src/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/network.conf: Setting WithNetwork should be configured in [Build], not [Content]

(cherry picked from commit 301c159ce526933d048b9fd02ad7e2adfb4a6c58)

11 months agoRevert "semaphore: skip some tests"
Luca Boccassi [Fri, 13 Dec 2024 23:43:28 +0000 (23:43 +0000)] 
Revert "semaphore: skip some tests"

This reverts commit e19cae12ff2e832ce7d79aa483e1aa27ed0ea1f4.

(cherry picked from commit 7406e0a3afafc1e1c994a88a4e988e94177e5550)

11 months agosemaphore: bump timeout
Luca Boccassi [Fri, 13 Dec 2024 22:08:27 +0000 (22:08 +0000)] 
semaphore: bump timeout

When semaphore is overloaded tests can take more than 1hr, bump
timeout

(cherry picked from commit 1855064d4eb95abe6909a93f72bee46658dad36b)

11 months agotmpfiles: reduce quoting in warning message
Zbigniew Jędrzejewski-Szmek [Thu, 7 Nov 2024 14:45:24 +0000 (15:45 +0100)] 
tmpfiles: reduce quoting in warning message

We printed:
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/20-systemd-shell-extra.conf:10: Unknown modifiers in command 'L$'.
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/systemd-network.conf:10: Unknown modifiers in command 'd$'.
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/systemd-network.conf:11: Unknown modifiers in command 'd$'.
...

There's a lot of additional characters here make the message harder to parse. We know
that the command is a word without any whitespace, so quoting isn't really necessary.

Change this to:
... unknown modifiers in command: L$

(cherry picked from commit 390bab53923eea822ac525d0e4aa4b7f86d8cd92)

11 months agologind: let system-wide idle begin at the time logind was initialized
Florian Schmaus [Sat, 16 Nov 2024 09:29:35 +0000 (10:29 +0100)] 
logind: let system-wide idle begin at the time logind was initialized

Initialize the start of the system-wide idle time with the time logind was
initialized and not with the start of the Unix epoch. This means that systemd
will not repport a unreasonable long idle time (around 54 years at the time of
writing this), especially at in the early boot, while no login manager session,
e.g,. gdm, had a chance to provide a more accurate start of the idle period.

Fixes #35163

(cherry picked from commit 718b31138b9a93f262259f297ad6b521454decc6)

11 months agoshell-completion: add smbios11 verb to systemd-analyze
Luca Boccassi [Thu, 12 Dec 2024 12:41:45 +0000 (12:41 +0000)] 
shell-completion: add smbios11 verb to systemd-analyze

Follow-up for 8c5045f9b2681774e8731dc0d142c207b61aedf6

(cherry picked from commit e7fce6a370894de3a3ded32910e0a4b251d805df)

11 months agomkosi: update debian commit reference
Luca Boccassi [Thu, 12 Dec 2024 16:46:11 +0000 (16:46 +0000)] 
mkosi: update debian commit reference

e8b7c9a4dd Install 81-net-bridge.rules
50d2997a07 Install systemd-creds bash completion
ff0c42823c test: fix flaky boot-and-services test
2a19dee4ba test: fix flaky boot-and-services test
a15a0bfe60 Update changelog for 257-2 release
c24eafcb7e Backport patches to fix test failures
29840f9b68 udev: install dmi_memory_id and its rules on riscv64
44893bdb32 Update changelog for 257-1 release
7f71d995fb Update symbols file for v257
2dd2b80499 Update upstream source from tag 'upstream/257'
51a3271a85 Update changelog for 257~rc3-1 release
8e687227c5 Update symbols for 257~rc3
c9bae527d6 Drop patches, merged upstream
e8cf329870 Update upstream source from tag 'upstream/257_rc3'
794457516d autopkgtest: fix one more tzdata dependency
16bb143da1 Bump version in tzdata dependency due to p-u upload
f2ddf70604 sysctl: Add file trigger on /usr/lib/sysctl.d to restart systemd-sysctl
79260cb0f4 Increase minimum sections in stub PE header on arm64/armhf/riscv64 to 500
ed3af24635 systemd-ukfy: recommend systemd-boot-efi for the stub

(cherry picked from commit 8d20606eec236232fb003594b3e6c88131744f6b)

11 months agotest-loop-block: return -77 on skip in more places
Luca Boccassi [Wed, 13 Nov 2024 14:20:34 +0000 (14:20 +0000)] 
test-loop-block: return -77 on skip in more places

(cherry picked from commit 81e0693465402d2e72cb3ba1b28e25e3c4c0206a)

11 months agobattery-check: parse options before checking for kernel command line
Luca Boccassi [Fri, 8 Nov 2024 12:23:37 +0000 (12:23 +0000)] 
battery-check: parse options before checking for kernel command line

Otherwise --help/--version/etc which exit immediately will do pointless work

(cherry picked from commit 60d23b7f4ae26d934e5748d30bb7ae956f3ad83d)

11 months agounits: use PrivateTmp=disconnected instead of 'yes' if DefaultDependencies=no
Luca Boccassi [Thu, 12 Dec 2024 11:48:52 +0000 (11:48 +0000)] 
units: use PrivateTmp=disconnected instead of 'yes' if DefaultDependencies=no

Avoids subtle race conditions such as the one described at
#35582.

Fixes #35582

(cherry picked from commit 1ca315be0097bccc9ff55e09ac339a48fdb9a040)

11 months agomkosi: Fix opensuse build
Daan De Meyer [Thu, 12 Dec 2024 11:58:42 +0000 (11:58 +0000)] 
mkosi: Fix opensuse build

The opensuse spec still looks for README.testsuite so hack it to look
for README.md instead now that we changed the name in the repo.

(cherry picked from commit 3aa725732161f11788a51405f9c5204190e7a0e9)

11 months agoexec-util: allow to invoke polkit/ask-password agent even if STDIN is not a tty
Yu Watanabe [Sun, 1 Dec 2024 08:36:33 +0000 (17:36 +0900)] 
exec-util: allow to invoke polkit/ask-password agent even if STDIN is not a tty

Closes #35018.

(cherry picked from commit 0f81c8406f0f47175c699715e84de8291057033c)

11 months agomanager: add list of subscribers to dump info
Ronan Pigott [Thu, 28 Nov 2024 19:52:45 +0000 (12:52 -0700)] 
manager: add list of subscribers to dump info

This is handy for debugging.

(cherry picked from commit 91713841491d0d4775566ed59f621f0f9a2413b5)

11 months agodbus: log disconnect on api and system busses
Ronan Pigott [Thu, 28 Nov 2024 19:51:38 +0000 (12:51 -0700)] 
dbus: log disconnect on api and system busses

This is an interesting event. Let's log about it.

(cherry picked from commit 11ee1bab60abde67cd0edc470c93c1afe10d975d)

11 months agojournalctl: honor --quiet with --setup-keys
Yu Watanabe [Tue, 10 Dec 2024 00:40:43 +0000 (09:40 +0900)] 
journalctl: honor --quiet with --setup-keys

Closes #35504.

(cherry picked from commit a5b2973850e5952b9dffdfa3f6a0ef486957cb17)

11 months agomeson.version: change to 257.1
Luca Boccassi [Thu, 12 Dec 2024 13:11:51 +0000 (13:11 +0000)] 
meson.version: change to 257.1

This is used to detect in various CIs that we are on a stable branch,
so set the new version early, otherwise some scripts will think it's
running in main

11 months agoREADME: drop CentOS CI badges
Yu Watanabe [Thu, 12 Dec 2024 02:58:24 +0000 (11:58 +0900)] 
README: drop CentOS CI badges

CentOS CIs are disabled after ead814a0b0f64c572282b9e27a0a995893f10cf0.

(cherry picked from commit 1fe583861feb5796fa0be937dc7f4c2ce07bcde5)

11 months agotest: add more coverage for extensions and verity
Luca Boccassi [Thu, 12 Dec 2024 00:50:45 +0000 (00:50 +0000)] 
test: add more coverage for extensions and verity

(cherry picked from commit c7fcb08324774c62bd2a786b03a7104a33049db6)

11 months agocore: fix loading verity settings for MountImages=
Luca Boccassi [Thu, 12 Dec 2024 00:24:05 +0000 (00:24 +0000)] 
core: fix loading verity settings for MountImages=

The MountEntry logic was refactored to store the verity
settings, and updated for ExtensionImages=, but not for
MountImages=.

Follow-up for a1a40297dbfa5bcd926d1a19320deb73c033c6f5

(cherry picked from commit 59a83e11887e13a35d88fd7dc71a13b450433715)

11 months agoshell completion: add systemd-creds
Luca Boccassi [Tue, 10 Dec 2024 22:19:09 +0000 (22:19 +0000)] 
shell completion: add systemd-creds

(cherry picked from commit 783f794e89996ae7f2ae1872d65c515a672437fa)

11 months agosemaphore: skip some tests
Luca Boccassi [Wed, 11 Dec 2024 20:44:25 +0000 (20:44 +0000)] 
semaphore: skip some tests

semaphore CI runs are always very close to the limit of 1hr, and often
time out when it's particularly oversubscribed.
Skip some low-value test cases to shorten the runtime.

(cherry picked from commit e19cae12ff2e832ce7d79aa483e1aa27ed0ea1f4)

11 months agosystemd-cryptenroll.xml: fix typo
Carlo Teubner [Wed, 11 Dec 2024 22:40:07 +0000 (22:40 +0000)] 
systemd-cryptenroll.xml: fix typo

(cherry picked from commit dfbd4d8bc5f18746051929e32f772078d6782e90)

11 months agoman: update example in systemd-measure.xml (#35506)
cvlc12 [Wed, 11 Dec 2024 21:09:11 +0000 (22:09 +0100)] 
man: update example in systemd-measure.xml (#35506)

In the example from systemd-measure(1), do not bind to PCR 7 in
addition to the PCR policy.

As long as this is still done by default, see #35280.

(cherry picked from commit 693038fce47a819c5eebeb4fce39c9ac991acf84)

11 months agotest-bpf-restrict-fs: Migrate to new assertion macros
Daan De Meyer [Wed, 11 Dec 2024 12:44:26 +0000 (12:44 +0000)] 
test-bpf-restrict-fs: Migrate to new assertion macros

(cherry picked from commit 1c658c639db1c902266735754f2e2883fe67d1d9)

11 months agoFixing VLAN ranges in man systemd.network.
andrejpodzimek [Wed, 11 Dec 2024 12:46:43 +0000 (12:46 +0000)] 
Fixing VLAN ranges in man systemd.network.

Otherwise it doesn't hold that VLANs 100-400 are allowed (because 201-299 are disallowed).

(cherry picked from commit ae2f3af63962ba6e2f67cfce07c9fee61722e30e)

11 months agoprofile.d: don't bail if $SHELL_* variables are unset
Tobias Klauser [Wed, 11 Dec 2024 14:10:39 +0000 (15:10 +0100)] 
profile.d: don't bail if $SHELL_* variables are unset

If - for whatever reason - a script uses set -u (nounset) and includes
/etc/profile.d/70-systemd-shell-extra.sh (e.g. transitively via
/etc/profile) the script would fail with:

    /etc/profile.d/70-systemd-shell-extra.sh: line 15: SHELL_PROMPT_PREFIX: unbound variable

For example:

    $ cat > foo.sh <<EOF
    #!/bin/sh
    set -u

    source /etc/profile
    EOF
    $ chmod 700 foo.sh
    $ ./foo.sh
    /etc/profile.d/70-systemd-shell-extra.sh: line 15: SHELL_PROMPT_PREFIX: unbound variable

Fix this by using shell parameter substitution[^1] (which is a POSIX
shell concept) to set the $SHELL_* variables to the empty string if
undefined.

[^1]: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/utilities/V3_chap02.html

(cherry picked from commit 12e33d332b3f8754f4d5d0d21d5d3f0de8adc54c)

11 months agoman: document unprivileged is not for reading properties
Katariina Lounento [Mon, 9 Dec 2024 14:09:13 +0000 (16:09 +0200)] 
man: document unprivileged is not for reading properties

Document the fact that read-only properties may not have the flag
SD_BUS_VTABLE_UNPRIVILEGED as that is not obvious especially given the
flag is accepted for writable properties.

Based on the check in `add_object_vtable_internal` called by
`sd_bus_add_object_vtable` (as of the current tip of the main branch
f7f5ba019206cacd486b0892fec76f70f525e04d):

    case _SD_BUS_VTABLE_PROPERTY: {
            [...]
            if ([...] ||
                [...]
                (v->flags & SD_BUS_VTABLE_UNPRIVILEGED && v->type == _SD_BUS_VTABLE_PROPERTY)) {
                    r = -EINVAL;
                    goto fail;
            }

(where `_SD_BUS_VTABLE_PROPERTY` means read-only property whereas
`_SD_BUS_VTABLE_WRITABLE_PROPERTY` maps to writable property).

This was implemented in the commit
adacb9575a09981fcf11279f2f661e3fc21e58ff ("bus: introduce "trusted" bus
concept and encode access control in object vtables") where
`SD_BUS_VTABLE_UNPRIVILEGED` was introduced:

    Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED
    and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them.
    Note however that read access is unrestricted, as PropertiesChanged
    messages might send out the values anyway as an unrestricted
    broadcast.

(cherry picked from commit 3ca09aa4dd57327989eceb1298754601046ac041)

11 months agomkosi: use inetutils package instead of hostname for Archlinux
Luca Boccassi [Wed, 11 Dec 2024 11:48:09 +0000 (11:48 +0000)] 
mkosi: use inetutils package instead of hostname for Archlinux

In Arch the hostname binary is in a different package

Follow-up for cf48bde7aea52b18ac3fa218d3f60fd3d533ef66

(cherry picked from commit 446d737cba3652a9f3dbd07cea9cb4082350b241)

11 months agotest-fd-util: compare FDs to /bin/sh instead of /dev/null
Luca Boccassi [Wed, 11 Dec 2024 13:40:10 +0000 (13:40 +0000)] 
test-fd-util: compare FDs to /bin/sh instead of /dev/null

/dev/null is a character device, so same_fd() in the fallback path
that compares fstat will fail, as that bails out if the fd refers
to a char device. This happens on kernels without F_DUPFD_QUERY and
without kcmp.

/* test_same_fd */
Assertion 'same_fd(d, e) > 0' failed at src/test/test-fd-util.c:111, function test_same_fd(). Aborting.

Fixes #35552

(cherry picked from commit 3b32d333e88f2a66651d58e32e01599fa84c3d19)

11 months agotest-fd-util: skip test when lacking privileges to create a new namespace
Luca Boccassi [Wed, 11 Dec 2024 12:01:18 +0000 (12:01 +0000)] 
test-fd-util: skip test when lacking privileges to create a new namespace

To reproduce, as an unprivileged user start a docker container and build
and run the unit tests inside it:

$ docker run --rm -ti debian:bookworm bash
...
/* test_close_all_fds */
Successfully forked off '(caf-plain)' as PID 10496.
Skipping PR_SET_MM, as we don't have privileges.
(caf-plain) succeeded.
Failed to fork off '(caf-noproc)': Operation not permitted
Assertion 'r >= 0' failed at src/test/test-fd-util.c:392, function test_close_all_fds(). Aborting.

Partially fixes #35552

(cherry picked from commit 630a2e7ee195ca96e102acac8df67a278a879124)