]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agocore: free the strings in the set as well during unit cleanup 28551/head
Frantisek Sumsal [Fri, 28 Jul 2023 10:24:32 +0000 (12:24 +0200)] 
core: free the strings in the set as well during unit cleanup

Spotted while fuzzing #27890.

=================================================================
==908098==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x7f4efe6d81f5 in __interceptor_realloc.part.0 (/lib64/libasan.so.8+0xd81f5) (BuildId: dc689b05ca2577037af24700212bb5cce1f91c8a)
    #1 0x7f4efb8e3ace in greedy_realloc ../src/basic/alloc-util.c:70
    #2 0x7f4efb93b713 in extract_first_word ../src/basic/extract-word.c:62
    #3 0x7f4efb970d50 in set_put_strsplit ../src/basic/hashmap.c:1902
    #4 0x7f4efd76c27e in exec_context_deserialize ../src/core/execute-serialize.c:3341
    #5 0x7f4efd778dcb in exec_deserialize ../src/core/execute-serialize.c:4122
    #6 0x4032c0 in LLVMFuzzerTestOneInput ../src/core/fuzz-execute-serialize.c:60
    #7 0x403c58 in main ../src/fuzz/fuzz-main.c:50
    #8 0x7f4efecccb49 in __libc_start_call_main (/lib64/libc.so.6+0x27b49) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #9 0x7f4efecccc0a in __libc_start_main_alias_2 (/lib64/libc.so.6+0x27c0a) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #10 0x402344 in _start (/home/mrc0mmand/repos/@systemd/systemd/build-san/fuzz-execute-serialize+0x402344) (BuildId: 195f382cf1e39b9ba48d6dcf5a90f786d72837a8)

SUMMARY: AddressSanitizer: 64 byte(s) leaked in 1 allocation(s).
Aborted (core dumped)

==911550==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 17 byte(s) in 1 object(s) allocated from:
    #0 0x4df281 in strdup (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x4df281) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #1 0x7fe4ae2b38fc in _set_put_strndup_full /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/basic/hashmap.c:1868:21
    #2 0x7fe4b0bad897 in exec_context_deserialize /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/execute-serialize.c:3914:29
    #3 0x7fe4b0b80592 in exec_deserialize /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/execute-serialize.c:4109:13
    #4 0x531d0f in LLVMFuzzerTestOneInput /home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/../src/core/fuzz-execute-serialize.c:59:16
    #5 0x440594 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x440594) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #6 0x43f9b9 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x43f9b9) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #7 0x440fd5 in fuzzer::Fuzzer::MutateAndTestOne() (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x440fd5) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #8 0x441955 in fuzzer::Fuzzer::Loop(std::vector<fuzzer::SizedFile, std::allocator<fuzzer::SizedFile>>&) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x441955) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #9 0x42e151 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x42e151) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #10 0x45a916 in main (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x45a916) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
    #11 0x7fe4ac449b49 in __libc_start_call_main (/lib64/libc.so.6+0x27b49) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #12 0x7fe4ac449c0a in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x27c0a) (BuildId: 245240a31888ad5c11bbc55b18e02d87388f59a9)
    #13 0x422b74 in _start (/home/mrc0mmand/repos/@systemd/systemd/build-libfuzz/fuzz-execute-serialize+0x422b74) (BuildId: 4e58706e607b8be7972d83c421bc0b625d509ec6)
SUMMARY: AddressSanitizer: 17 byte(s) leaked in 1 allocation(s).

2 years agoukify: fix armv7 architecture mapping
Luca Boccassi [Mon, 24 Jul 2023 17:06:30 +0000 (18:06 +0100)] 
ukify: fix armv7 architecture mapping

$ uname -m
armv7l

Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 223, in <module>
    main()
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 219, in main
    call_ukify(opts)
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/src/kernel-install/60-ukify.install", line 205, in call_ukify
    ukify['finalize_options'](opts2)
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/ukify", line 1423, in finalize_options
    opts.efi_arch = guess_efi_arch()
                    ^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/obj-arm-linux-gnueabihf/ukify", line 78, in guess_efi_arch
    raise ValueError(f'Unsupported architecture {arch}')
ValueError: Unsupported architecture armv7l

2 years agoshell-completion: include units in 'verify' completions
Frantisek Sumsal [Mon, 24 Jul 2023 18:21:17 +0000 (20:21 +0200)] 
shell-completion: include units in 'verify' completions

Resolves: #28500

2 years agoMerge pull request #28505 from bluca/vconsole_debian
Luca Boccassi [Mon, 24 Jul 2023 17:02:32 +0000 (18:02 +0100)] 
Merge pull request #28505 from bluca/vconsole_debian

vconsole-setup: don't fail with an empty keymap

2 years agomkosi: set default-keymap='' on Debian/Ubuntu 28505/head
Luca Boccassi [Mon, 24 Jul 2023 14:35:47 +0000 (15:35 +0100)] 
mkosi: set default-keymap='' on Debian/Ubuntu

2 years agovconsole-setup: don't fail with an empty keymap
Luca Boccassi [Mon, 24 Jul 2023 14:31:02 +0000 (15:31 +0100)] 
vconsole-setup: don't fail with an empty keymap

The new meson option 'default-keymap' means that by default there's always
a keymap to configure, so vconsole-setup fails. Allow to set
-Ddefault-keymap="" to disable it and skip gracefully again.

Follow-up for f129d0e77c4c9a0e12ae38cd241cd49846844a80

2 years agoNEWS: update for rc3 v254-rc3
Luca Boccassi [Mon, 24 Jul 2023 11:03:20 +0000 (12:03 +0100)] 
NEWS: update for rc3

2 years agoMerge pull request #28503 from bluca/rc
Zbigniew Jędrzejewski-Szmek [Mon, 24 Jul 2023 11:42:17 +0000 (13:42 +0200)] 
Merge pull request #28503 from bluca/rc

RC busywork

2 years agoNEWS: update contributors list 28503/head
Luca Boccassi [Mon, 24 Jul 2023 10:46:33 +0000 (11:46 +0100)] 
NEWS: update contributors list

2 years agohwdb: run update-hwdb
Luca Boccassi [Mon, 24 Jul 2023 10:40:51 +0000 (11:40 +0100)] 
hwdb: run update-hwdb

git diff hwdb.d/*.hwdb looks sensible

2 years agoMerge pull request #28498 from bluca/softreboot
Luca Boccassi [Mon, 24 Jul 2023 10:36:16 +0000 (11:36 +0100)] 
Merge pull request #28498 from bluca/softreboot

softreboot: ensure all processes are killed

2 years agoMerge pull request #28497 from bluca/run
Luca Boccassi [Mon, 24 Jul 2023 10:20:06 +0000 (11:20 +0100)] 
Merge pull request #28497 from bluca/run

switch-root: use MS_REC for /run, unless we are soft-rebooting

2 years agoUpdate NEWS 28498/head
Luca Boccassi [Sat, 22 Jul 2023 22:35:49 +0000 (23:35 +0100)] 
Update NEWS

2 years agosoftreboot: ensure all processes are killed
Luca Boccassi [Sat, 22 Jul 2023 22:35:40 +0000 (23:35 +0100)] 
softreboot: ensure all processes are killed

Having surviving processes is not ready yet as a feature, so ensure
everything is killed on the transition for now

2 years agotest: check if we correctly propagate /run mounts during switch root 28497/head
Frantisek Sumsal [Wed, 19 Jul 2023 12:26:26 +0000 (14:26 +0200)] 
test: check if we correctly propagate /run mounts during switch root

Since 7c764d4 we bind mount certain directories during switch root
instead of moving the mount directly, and for /run we do this without
MS_REC. This, unfortunately, leaves all mounts under /run behind
in the old root, which breaks certain use cases.

See: https://github.com/systemd/systemd/issues/28452

2 years agoswitch-root: use MS_REC for /run, unless we are soft-rebooting
Luca Boccassi [Sat, 22 Jul 2023 21:45:16 +0000 (22:45 +0100)] 
switch-root: use MS_REC for /run, unless we are soft-rebooting

There are applications that rely on mounts under /run surviving the
switch from initrd to rootfs, so use MS_REC unless we are soft
rebooting.

Follow-up for 7c764d45997721705e43ac66fbb5a56747d00d40

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

2 years agoRevert "core: add IgnoreOnSoftReboot= unit option"
Luca Boccassi [Sat, 22 Jul 2023 22:27:15 +0000 (23:27 +0100)] 
Revert "core: add IgnoreOnSoftReboot= unit option"

The feature is not ready, postpone it

This reverts commit b80fc61e8971283606f9cd0a48e31d0f701c82f1.

2 years agoRevert "network: delay to configure address until it is removed on reconfigure"
Yu Watanabe [Sat, 22 Jul 2023 06:10:49 +0000 (15:10 +0900)] 
Revert "network: delay to configure address until it is removed on reconfigure"

This reverts commit 6e8477edd3a988357ad5f5fa6610904d44ec402c.

The commit intended to fix a race reported at #28009. However,
unfortunately, it does not fix the root of the race, and reveals
the race in more simple setups. See reports in #28358.

2 years agopo: Translated using Weblate (Czech)
Daniel Rusek [Sat, 22 Jul 2023 16:21:00 +0000 (18:21 +0200)] 
po: Translated using Weblate (Czech)

Currently translated at 93.3% (212 of 227 strings)

Co-authored-by: Daniel Rusek <mail@asciiwolf.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main

2 years agotpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm...
Dan Streetman [Fri, 21 Jul 2023 15:23:22 +0000 (11:23 -0400)] 
tpm2: instead of adjusting authValue trailing 0(s), trim them as required by tpm spec

To keep compatibility with any existing object authValues with trailing 0's,
change tpm2_get_pin_auth() to trim trailing 0's, which is what the TPM
implementation will do. This should retain compatibility with any existing
authValues that contain trailing 0's.

Note that any existing authValues with trailing 0's are unlikely to have worked
in the way that systemd uses them in object sealing, which is as a bind key for
the encryption (and policy) session. However, it is better to be compatible
with the TPM spec (and implementations) even if previously created objects that
are affected may not have worked.

Fixes: #28414
2 years agoMerge pull request #28487 from yuwata/statx-fixlets
Luca Boccassi [Fri, 21 Jul 2023 22:09:40 +0000 (23:09 +0100)] 
Merge pull request #28487 from yuwata/statx-fixlets

util: fix error handling of statx()

2 years agoRevert "cryptenroll: drop unmet condition"
Dan Streetman [Fri, 21 Jul 2023 14:45:16 +0000 (10:45 -0400)] 
Revert "cryptenroll: drop unmet condition"

This reverts commit cefa4a02ab8f3c941e54b5ad1a90b5cf133264a7.

Because the first 'break' is inside a nested for loop, this second 'break' is
needed to exit the outer for loop.

Fixes: #28451
2 years agoMerge pull request #26541 from DaanDeMeyer/xfs-whitespace-fix
Luca Boccassi [Fri, 21 Jul 2023 17:58:27 +0000 (18:58 +0100)] 
Merge pull request #26541 from DaanDeMeyer/xfs-whitespace-fix

mkfs-util: Escape spaces with slashes in protofile format

2 years agofd-util: do not call statx() twice when it does not provide mount ID 28487/head
Yu Watanabe [Fri, 21 Jul 2023 16:31:16 +0000 (01:31 +0900)] 
fd-util: do not call statx() twice when it does not provide mount ID

Previously, in path_is_root_at(), if statx() does not provide mount ID,
path_get_mnt_id_at() was called, but it also calls statx(). Let's avoid
the second trial.

2 years agofd-util: make path_is_root_at() not fail even when /proc is mounted
Yu Watanabe [Fri, 21 Jul 2023 16:23:17 +0000 (01:23 +0900)] 
fd-util: make path_is_root_at() not fail even when /proc is mounted

path_get_mnt_id_at() -> fd_fdinfo_mnt_id() may return -EOPNOTSUPP when
/proc is mounted, and -ENOSYS otherwise, when an old kernel is used.

2 years agomountpoint-util: statx() may return EINVAL if the kernel does not support the syscall
Yu Watanabe [Fri, 21 Jul 2023 16:15:59 +0000 (01:15 +0900)] 
mountpoint-util: statx() may return EINVAL if the kernel does not support the syscall

When statx() is called with AT_STATX_DONT_SYNC, glibc's fallback code
returns EINVAL. See statx_generic() in glibc.

2 years agostat-util: fix error handling of statx()
Yu Watanabe [Fri, 21 Jul 2023 16:07:36 +0000 (01:07 +0900)] 
stat-util: fix error handling of statx()

When newer glibc is used, but kernel does not support statx(), then
glibc try to fallback with fstatat(). That's quite similar to our
implementation, but the supported flags are different, and if
unsupported flags are specified, it returns EINVAL.

Let's handle the case more gracefully.

2 years agoMerge pull request #28436 from rpigott/zsh-fixups
Zbigniew Jędrzejewski-Szmek [Fri, 21 Jul 2023 17:13:53 +0000 (19:13 +0200)] 
Merge pull request #28436 from rpigott/zsh-fixups

zsh systemctl completion fixups

2 years agocore: add IgnoreOnSoftReboot= unit option
Luca Boccassi [Thu, 20 Jul 2023 00:22:52 +0000 (01:22 +0100)] 
core: add IgnoreOnSoftReboot= unit option

As it says on the tin, configures the unit to survive a soft reboot.
Currently all the following options have to be set by hand:

Conflicts=reboot.target kexec.target poweroff.target halt.target
Before=reboot.target kexec.target poweroff.target halt.target
After=sysinit.target basic.target
DefaultDependencies=no
IgnoreOnIsolate=yes

This is not very user friendly. If new default dependencies are added,
or new shutdown/reboot types, they also have to be added manually.

The new option is much simpler, easy to find, and does the right thing
by default.

2 years agoMerge pull request #28460 from bluca/scope_run_env
Zbigniew Jędrzejewski-Szmek [Fri, 21 Jul 2023 13:41:56 +0000 (15:41 +0200)] 
Merge pull request #28460 from bluca/scope_run_env

run: disable --expand-environment by default for --scope

2 years agomkfs-util: Escape spaces with slashes in protofile format 26541/head
Daan De Meyer [Wed, 22 Feb 2023 13:36:14 +0000 (14:36 +0100)] 
mkfs-util: Escape spaces with slashes in protofile format

2 years agotest-ukify: use systemd-measure and bootctl in build directory
Yu Watanabe [Thu, 20 Jul 2023 11:26:24 +0000 (20:26 +0900)] 
test-ukify: use systemd-measure and bootctl in build directory

And skip tests if systemd-measure is not found.
Then, we can safely run test_ukify.py directly.

2 years agoxfs: Bump minimal size to 300M
Daan De Meyer [Fri, 21 Jul 2023 12:21:44 +0000 (14:21 +0200)] 
xfs: Bump minimal size to 300M

From the xfsprogs source code:

* We don't support filesystems smaller than 300MB anymore.  Tiny
* filesystems have never been XFS' design target.  This limit has been
* carefully calculated to prevent formatting with a log smaller than
* the "realistic" size.
*
* If the realistic log size is 64MB, there are four AGs, and the log
* AG should be at least 1/8 free after formatting, this gives us:
*
* 64MB * (8 / 7) * 4 = 293MB

So let's accommodate and bump the minimal XFS filesystem size to 300M.

2 years agohomework-luks: fix typos
Topi Miettinen [Fri, 21 Jul 2023 11:55:40 +0000 (11:55 +0000)] 
homework-luks: fix typos

2 years agoudev: decrease devlink priority for iso disks
Yu Watanabe [Fri, 21 Jul 2023 02:39:45 +0000 (11:39 +0900)] 
udev: decrease devlink priority for iso disks

Previously, if the priority is same, devlinks are always replaced by
newer events. The commit 331aa7aa15ee5dd12b369b276f575d521435eb52 changes
that to keep the existing devlink. That should not change any behavior
when the devices that request the same symlink do not have any
dependency, e.g. when /dev/sda1 and /dev/adb1 request the same
/dev/disk/by-label symlink, as there are no guarantee that which device
is processed first.

However, when devices has dependency, e.g. /dev/sda and /dev/sda1
request the same /dev/disk/by-label symlink, previously the symlink
always pointed to the partition, as the partition is always processed
later. But, 331aa7aa15ee5dd12b369b276f575d521435eb52 makes the symlink
point to the whole disk.

The change by 331aa7aa15ee5dd12b369b276f575d521435eb52 is crucial to
improve performance of devlink handling, especially when a system has
large number of disks with same label or so. Hence, cannot and should
not be reverted.

So, let's workaround the case, as such situation should happen only when
the disk is a hybrind ISO image, I guess.

Fixes #28468.

2 years agotree-wide: fix typo found by Fossies Codespell report
Yu Watanabe [Fri, 21 Jul 2023 10:12:08 +0000 (19:12 +0900)] 
tree-wide: fix typo found by Fossies Codespell report

2 years agorepart: Set sector size of loopback devices
Michael A Cassaniti [Fri, 21 Jul 2023 01:41:09 +0000 (11:41 +1000)] 
repart: Set sector size of loopback devices

When an explicit sector size is set by the user it is also necessary to set the
sector size of any loopback devices. If the sector size is not set for loopback
devices then it can cause file system creation to fail or run into odd issues.

2 years agoudev: downgrade log level when running without cgroup
Yu Watanabe [Fri, 21 Jul 2023 01:00:27 +0000 (10:00 +0900)] 
udev: downgrade log level when running without cgroup

The cgroup path is optional, hence it is not necessary to warn the
failure loudly.

Follow-up for f8371dbd56d27621932ecbe3f5c1246e925fd53a.

Closes #28469.

2 years agotree-wide: drop references to /dev/loop/by-ref
Yu Watanabe [Fri, 21 Jul 2023 01:24:17 +0000 (10:24 +0900)] 
tree-wide: drop references to /dev/loop/by-ref

Follow-up for #28476.

2 years agoMerge pull request #28476 from bluca/revert_loop_links
Yu Watanabe [Fri, 21 Jul 2023 01:21:06 +0000 (10:21 +0900)] 
Merge pull request #28476 from bluca/revert_loop_links

Revert "udev: add /dev/loop/ symlinks"

2 years agoRevert "udev: add /dev/loop/ symlinks" 28476/head
Luca Boccassi [Thu, 20 Jul 2023 21:28:13 +0000 (22:28 +0100)] 
Revert "udev: add /dev/loop/ symlinks"

Turns out this causes a regression and breaks losetup. It will need to
be reworked in conjunction with util-linux changes.

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

This reverts commit 5ac52d1f7b7cd11cad8b5c2e9812d7ee7560a517.

2 years agoRevert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop...
Luca Boccassi [Thu, 20 Jul 2023 21:26:40 +0000 (22:26 +0100)] 
Revert "test: test new systemd-dissect --attach/--detach/--loop-ref= and /dev/loop/* symlinks"

This reverts commit f5e46b9e09d4ff3f1e6ee6e3a90adc704780a661.

2 years agoNEWS: note that sd-run --expand-environment will change 28460/head
Luca Boccassi [Thu, 20 Jul 2023 16:41:38 +0000 (17:41 +0100)] 
NEWS: note that sd-run --expand-environment will change

2 years agorun: disable --expand-environment by default for --scope
Luca Boccassi [Wed, 19 Jul 2023 21:56:02 +0000 (22:56 +0100)] 
run: disable --expand-environment by default for --scope

The intention was to have this option enabled by default everywhere,
but unfortunately at least one case was found where it breaks
compatibility of a program using systemd-run --scopes and expecting
variables not to be expanded:

https://sources.debian.org/src/pbuilder/0.231/pbuilder-checkparams/#L400

Example run:

systemd-run --quiet --scope --description=pbuilder_build_xfce4-notes-plugin_1.10.0-1.dsc '--slice=system-pbuilder-build-xfce4\x2dnotes\x2dplugin_1.10.0\x2d1-449932.slice' chroot /var/cache/pbuilder/build/449932 dpkg-query -W '--showformat=${Version}' apt

Restore backward compatibility and make the option disabled by default
when --scope is used, and enabled by default for other types.

In case --expand-environment is not specified and a '$' character is
detected, print a warning to nudge users toward specifying the
parameter as needed. In the future we can then flip the default.

Follow-up for 2ed7a221fafb25eea937c4e86fb88ee501dba51e

2 years agotest: use XDG_STATE_HOME for %S and %L
Yu Watanabe [Thu, 20 Jul 2023 07:07:58 +0000 (16:07 +0900)] 
test: use XDG_STATE_HOME for %S and %L

This fixes the test failure when invoked by a user.
===
Running ./systemd-tmpfiles --user on 'f /tmp/test-systemd-tmpfiles.1foag_ur/test-content.n_9r_xhm/arg - - - - %S'
expect: '/home/watanabe/.config'
actual: '/home/watanabe/.local/state'
Traceback (most recent call last):
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 233, in <module>
    test_valid_specifiers(user=True)
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 135, in test_valid_specifiers
    test_content('f {} - - - - %S',
  File "/home/watanabe/git/systemd/test/test-systemd-tmpfiles.py", line 88, in test_content
    assert content == expected
           ^^^^^^^^^^^^^^^^^^^
AssertionError
===

This also makes the test uses fallback paths.

Follow-up for b50aadaff22f9b3ad3bbcbfd2edd661456a5b4bf.

2 years agotest: fix a syntax error in test-ukify
Yu Watanabe [Thu, 20 Jul 2023 07:42:35 +0000 (16:42 +0900)] 
test: fix a syntax error in test-ukify

Follow-up for d7d36252e5fdc345b110f824031e20f41ee75e86.

Fixes #28464.

2 years agozsh: use glob matching for template names 28436/head
Ronan Pigott [Wed, 19 Jul 2023 21:26:14 +0000 (14:26 -0700)] 
zsh: use glob matching for template names

Template names can be learned from the filesystem, so there isn't a need
to parse the output of systemctl list-unit-files in this case. This
should accelerate the completion of some verbs like enable.

2 years agozsh: remove unit property caching
Ronan Pigott [Tue, 18 Jul 2023 23:52:18 +0000 (16:52 -0700)] 
zsh: remove unit property caching

The existing caching policy isn't very sensible for this cache. We could
write a different policy, but I don't think there is much value in
caching these values, as in my experience the command used to generate
them is quick.

2 years agozsh: update default caching policy for units
Ronan Pigott [Mon, 17 Jul 2023 23:24:36 +0000 (16:24 -0700)] 
zsh: update default caching policy for units

The existing caching policy was completely bogus.

In the first stanza, despite the comment, the pattern given would
consider the cache invalid if it was more than 1 hour old.

The second stanza was also incorrect, since the output of `systemctl
--all` is not unit file paths, but unit names. When they were being
tested against the cachefile mtime, the test would always fail becuase
of the nonexistant file (hopefully).

In fact it's not very useful to test if the unit files have newer mtime
in this case anyway, since we are only caching their names. Also,
`systemctl --all` is an unfortunately slow operation to be used in
testing for the cache validity — we want this operation to at least be
faster than rebuilding the cache.

I've rewritten this stanza with my best guess at its original intent. It
now checks against the mtime of the parent directories in the search
path, which should be updated and cause the cache to rebuild when we
add, remove, or rename any unit files.

2 years agoman: clarify DNSSEC= again
Zbigniew Jędrzejewski-Szmek [Wed, 19 Jul 2023 12:16:15 +0000 (14:16 +0200)] 
man: clarify DNSSEC= again

https://github.com/systemd/systemd/pull/28407#issuecomment-1640900239

2 years agolocale-util: fix _() definition
Dmitry V. Levin [Tue, 18 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
locale-util: fix _() definition

The previous definition was not quite appropriate for the library code
because it relied on the message domain set by textdomain() invocation
which is not necessarily the same message domain defined in
GETTEXT_PACKAGE macro.

The only code that uses _() so far is located in pam_systemd_home.c.

Fixes: 20f56fddcd5 ("Add gettext support")
2 years agoMerge pull request #28445 from bluca/run_host_release
Luca Boccassi [Wed, 19 Jul 2023 08:34:06 +0000 (09:34 +0100)] 
Merge pull request #28445 from bluca/run_host_release

core: copy the host's os-release for /run/host/os-release

2 years agoMerge pull request #28447 from mrc0mmand/test-network
Daan De Meyer [Wed, 19 Jul 2023 06:07:31 +0000 (08:07 +0200)] 
Merge pull request #28447 from mrc0mmand/test-network

network: fix fetching link properties

2 years agokernel-install: silently ignore unexpected arguments for 'remove' command
Yu Watanabe [Wed, 19 Jul 2023 01:47:53 +0000 (10:47 +0900)] 
kernel-install: silently ignore unexpected arguments for 'remove' command

The shell script version of kernel-install silently ignored unexpected
arguments, but C version refused that. Unfortunately, Fedora's kernel
script specifies kernel file even for 'remove' command. Let's accept
extra arguments and silently ignore them to keep backward compatibility.

Fixes #28448.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2223794.

2 years agonetwork: fix fetching link properties 28447/head
Frantisek Sumsal [Tue, 18 Jul 2023 20:47:43 +0000 (22:47 +0200)] 
network: fix fetching link properties

This fixes regression introduced in 5a0c810462 with which all requests
for link properties ended up with EINVAL as we kept hitting
the signature_is_single() assert in sd_bus_get_property().

2 years agotest-network: probe a couple of uncovered networkctl codepaths
Frantisek Sumsal [Tue, 18 Jul 2023 19:28:54 +0000 (21:28 +0200)] 
test-network: probe a couple of uncovered networkctl codepaths

2 years agotest-network: validate JSON where applicable
Frantisek Sumsal [Tue, 18 Jul 2023 19:39:36 +0000 (21:39 +0200)] 
test-network: validate JSON where applicable

2 years agorepart: Always take --offline into account
Daan De Meyer [Tue, 18 Jul 2023 13:09:41 +0000 (15:09 +0200)] 
repart: Always take --offline into account

2 years agoNEWS: note that /run/host/os-release is available more broadly 28445/head
Luca Boccassi [Tue, 18 Jul 2023 14:50:57 +0000 (15:50 +0100)] 
NEWS: note that /run/host/os-release is available more broadly

2 years agoman: explicitly note that units surviving soft-reboot should not pin resources
Luca Boccassi [Tue, 18 Jul 2023 14:48:59 +0000 (15:48 +0100)] 
man: explicitly note that units surviving soft-reboot should not pin resources

2 years agocore: copy the host's os-release for /run/host/os-release
Luca Boccassi [Tue, 18 Jul 2023 14:44:27 +0000 (15:44 +0100)] 
core: copy the host's os-release for /run/host/os-release

Currently for portable services we automatically add a bind mount
os-release -> /run/host/os-release. This becomes problematic for the
soft-reboot case, as it's likely that portable services will be configured
to survive it, and thus would forever keep a reference to the old host's
os-release, which would be a problem because it becomes outdated, and also
it stops the old rootfs from being garbage collected.

Create a copy when the manager starts under /run/systemd/propagate instead,
and bind mount that for all services using RootDirectory=/RootImage=, so
that on soft-reboot the content gets updated (without creating a new file,
so the existing bind mounts will see the new content too).

This expands the /run/host/os-release protocol to more services, but I
think that's a nice thing to have too.

Closes https://github.com/systemd/systemd/issues/28023

2 years agoDeprecate efivar SystemdOptions
Zbigniew Jędrzejewski-Szmek [Mon, 17 Jul 2023 18:55:47 +0000 (20:55 +0200)] 
Deprecate efivar SystemdOptions

As mentioned in the NEWS entry, it seems to see very little use, but adds
complexity in our code. It was added mainly with the goal of making it easier
for people using grub2 to modify their boot configuration, but grub2 is gaining
support for BLS snippets. On the systemd side, we now have credentials. So
let's deprecate this, and if there's no outcry, remove it in a few releases.

2 years agoInclude in manual what DNSSEC=no means in detail
Petr Menšík [Sat, 15 Jul 2023 02:11:25 +0000 (04:11 +0200)] 
Include in manual what DNSSEC=no means in detail

https://www.rfc-editor.org/rfc/rfc4035.html#section-3.2.1 says
security-aware recursive name server MUST set DO bit when sending
requests. systemd-resolved does not do that by design. State it more
clearly in manual page. Unlike other implementations it disables not
only validation as it stated, but complete DNSSEC awareness.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
2 years agoanalyze: don't warn about version spec compliant versions
Joerg Behrmann [Thu, 13 Jul 2023 09:07:03 +0000 (11:07 +0200)] 
analyze: don't warn about version spec compliant versions

This commits adds version_is_valid_versionspec and uses it in
analyze-compare-version.c.

version_is_valid_versionspec differs from version_is_valid in that it acepts
empty strings and since valid characters in a version spec version are all
ASCII letters and digits as well as "-.~^", but ",_+" allowed by
version_is_valid are not.

Also give a more specific warning message on invalid characters.

2 years agoRevert "packit: temporarily use older Rawhide spec"
Frantisek Sumsal [Fri, 14 Jul 2023 11:48:56 +0000 (13:48 +0200)] 
Revert "packit: temporarily use older Rawhide spec"

This reverts commit f1adb4a2ea2fd1d54ff8cc17a4d10f2b502cfc69.

2 years agoMerge pull request #28424 from mrc0mmand/networkd-ra-captive-portals
Yu Watanabe [Tue, 18 Jul 2023 13:02:44 +0000 (22:02 +0900)] 
Merge pull request #28424 from mrc0mmand/networkd-ra-captive-portals

test-network: check for captive portals received via NDISC

2 years agotest-resolved-stream: Use a random port number
Daan De Meyer [Tue, 18 Jul 2023 06:56:25 +0000 (08:56 +0200)] 
test-resolved-stream: Use a random port number

Hopefully fixes #28393

2 years agotest-network: check for captive portals received via NDISC 28424/head
Frantisek Sumsal [Mon, 17 Jul 2023 08:12:39 +0000 (10:12 +0200)] 
test-network: check for captive portals received via NDISC

This requires fairly recent radvd that supports sending RAs with captive
portals [0].

Also, this should hopefully provide coverage for issues like:
  - https://github.com/systemd/systemd/issues/28229
  - https://github.com/systemd/systemd/issues/28231
  - https://github.com/systemd/systemd/issues/28277

[0] https://github.com/radvd-project/radvd/pull/141

2 years agozsh: stop forcing unit file cache rebuilds
Ronan Pigott [Mon, 17 Jul 2023 23:06:59 +0000 (16:06 -0700)] 
zsh: stop forcing unit file cache rebuilds

Rebuilding whenever the cached parameter is not set forces each new
shell to rebuild the cache, which often defeates the purpose of caching
in the first place.

2 years agozsh: default to system manager when not specified
Ronan Pigott [Mon, 17 Jul 2023 21:47:23 +0000 (14:47 -0700)] 
zsh: default to system manager when not specified

This used to work correctly, before the change was reverted in
e09d0d46c297. In fact it is important to specify the manager explicity
in the completion because the argument is reused in the caching
policies. An empty argument here caused the completion to create
separate caches with and without the --system parameter. We can simplify
the given pattern a little here too.

2 years agozsh: suppress aliases and shell functions when calling systemctl
Ronan Pigott [Mon, 17 Jul 2023 23:17:20 +0000 (16:17 -0700)] 
zsh: suppress aliases and shell functions when calling systemctl

This prevents any errors in case the user had aliased some arguments
following systemctl.

2 years agozsh: typo in systemctl completions
Ronan Pigott [Mon, 17 Jul 2023 21:44:09 +0000 (14:44 -0700)] 
zsh: typo in systemctl completions

2 years agotest: exit early from TEST-70-TPM2 on ppc64el
Luca Boccassi [Mon, 17 Jul 2023 18:06:22 +0000 (19:06 +0100)] 
test: exit early from TEST-70-TPM2 on ppc64el

There is an underlying issue that appears only on ppc64 and fails 95%
of Ubuntu runs, so exit early until it is solved.

Closes https://github.com/systemd/systemd/issues/27716

2 years agoci: drop super-linter's shellcheck
Frantisek Sumsal [Mon, 17 Jul 2023 15:54:59 +0000 (17:54 +0200)] 
ci: drop super-linter's shellcheck

It's been a while since we introduced Differential ShellCheck and it
proved to be quite useful (and in some ways even better than the shellcheck
run by super-linter). So, to have only one linter scream at us for not
knowing how to write bash properly, let's drop the super-linter's one in
favor of Differential ShellCheck.

Follow-up for https://github.com/systemd/systemd/pull/24328#pullrequestreview-1074127504

2 years agoMerge pull request #28384 from ldv-alt/ERRNO_IS
Zbigniew Jędrzejewski-Szmek [Mon, 17 Jul 2023 16:07:07 +0000 (18:07 +0200)] 
Merge pull request #28384 from ldv-alt/ERRNO_IS

treewide: fix use of ERRNO_IS_*(r)

2 years agounits: Add --graceful flag to pcrphase units
Daan De Meyer [Mon, 17 Jul 2023 08:11:54 +0000 (10:11 +0200)] 
units: Add --graceful flag to pcrphase units

Some of the new units using systemd-pcrphase are missing the --graceful
flag which causes them to error if the tpm libraries are not installed.
Add --graceful just like in the other pcrphase units to make systemd-pcrphase
exit gracefully if the tpm libraries are missing.

2 years agoMerge pull request #28425 from weblate/weblate-systemd-master
Luca Boccassi [Mon, 17 Jul 2023 12:07:03 +0000 (13:07 +0100)] 
Merge pull request #28425 from weblate/weblate-systemd-master

Translations update from Fedora Weblate

2 years agopo: Translated using Weblate (Swedish) 28425/head
Luna Jernberg [Mon, 17 Jul 2023 11:20:59 +0000 (13:20 +0200)] 
po: Translated using Weblate (Swedish)

Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Luna Jernberg <bittin@reimu.nl>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/sv/
Translation: systemd/main

2 years agopo: Translated using Weblate (Korean)
김인수 [Mon, 17 Jul 2023 11:20:59 +0000 (13:20 +0200)] 
po: Translated using Weblate (Korean)

Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: 김인수 <simmon@nplob.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ko/
Translation: systemd/main

2 years agopo: Translated using Weblate (Czech)
Pavel Borecki [Mon, 17 Jul 2023 11:20:59 +0000 (13:20 +0200)] 
po: Translated using Weblate (Czech)

Currently translated at 93.3% (212 of 227 strings)

Co-authored-by: Pavel Borecki <pavel.borecki@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/cs/
Translation: systemd/main

2 years agotest-network: correctly support running systemd-udevd from the build dir
Frantisek Sumsal [Mon, 17 Jul 2023 10:55:12 +0000 (12:55 +0200)] 
test-network: correctly support running systemd-udevd from the build dir

We create the udevadm -> systemd-udevd symlink during the install phase,
so it doesn't exist in the just compiled tree. This worked in CI since
the symlink is manually created there post-build.

2 years agotest: fix use of ERRNO_IS_PRIVILEGE() 28384/head
Dmitry V. Levin [Fri, 7 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
test: fix use of ERRNO_IS_PRIVILEGE()

Given that ERRNO_IS_PRIVILEGE() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the arguments passed to ERRNO_IS_PRIVILEGE() are the values
returned by read_one_line_file() which can legitimately return positive
values without errno semantics, so fix this by moving ERRNO_IS_PRIVILEGE()
invocations to the branches where the return values are known to be negative.

2 years agotest: avoid TEST-70 passphrase and password file mode complaints
Dan Streetman [Sun, 16 Jul 2023 01:33:50 +0000 (21:33 -0400)] 
test: avoid TEST-70 passphrase and password file mode complaints

Minor change, to adjust mode of /tmp/passphrase and /tmp/password test files to
avoid repeated warning logs that each file "...has 0644 mode that is too
permissive, please adjust the ownership and access mode."

2 years agoresolved: fix use of ERRNO_IS_DISCONNECT()
Dmitry V. Levin [Fri, 7 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
resolved: fix use of ERRNO_IS_DISCONNECT()

Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by manager_recv() which can legitimately return 1 without errno
semantics, so fix this by moving ERRNO_IS_DISCONNECT() invocation to the
branch where the return value is known to be negative.

2 years agosd-bus: fix use of ERRNO_IS_DISCONNECT()
Dmitry V. Levin [Fri, 7 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
sd-bus: fix use of ERRNO_IS_DISCONNECT()

Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by bus_socket_process_watch_bind(), bus_socket_process_opening(),
and bus_socket_process_authenticating() which can legitimately return
positive values without errno semantics, so fix this by moving the
ERRNO_IS_DISCONNECT() invocation to the branch where the return value
is known to be negative.

2 years agosocket: fix use of ERRNO_IS_DISCONNECT()
Dmitry V. Levin [Fri, 7 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
socket: fix use of ERRNO_IS_DISCONNECT()

Given that ERRNO_IS_DISCONNECT() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_DISCONNECT() is the value
returned by socket_acquire_peer() which can legitimately return 1
without errno semantics, so fix this by moving ERRNO_IS_DISCONNECT()
invocation to the branch where the return value is known to be negative.

2 years agokbd-util: fix use of ERRNO_IS_RESOURCE()
Dmitry V. Levin [Fri, 7 Jul 2023 08:00:00 +0000 (08:00 +0000)] 
kbd-util: fix use of ERRNO_IS_RESOURCE()

Given that ERRNO_IS_RESOURCE() also matches positive values,
make sure this macro is not called with arguments that do not have
errno semantics.

In this case the argument passed to ERRNO_IS_RESOURCE() is the value
returned by recurse_dir_at() which can legitimately return positive
values without errno semantics, so fix this by moving the ERRNO_IS_RESOURCE()
invocation to the branch where the return value is known to be negative.

2 years agotpm2: add tpm2_get_pin_auth()
Dan Streetman [Sat, 15 Jul 2023 12:30:40 +0000 (08:30 -0400)] 
tpm2: add tpm2_get_pin_auth()

Add function to calculate the hash digest for a provided pin, and also verify
that the final byte in the digest is not 0. This is required because the TPM
will always remove all trailing 0's from an auth value before using it.

Fixes: #27716
2 years agoMerge pull request #28416 from bluca/gpt_mips
Daan De Meyer [Sat, 15 Jul 2023 19:07:56 +0000 (21:07 +0200)] 
Merge pull request #28416 from bluca/gpt_mips

Two more fixes for MIPS and sd-gpt

2 years agosd-gpt: __mips__ is also defined when building __mips64 28416/head
Luca Boccassi [Sat, 15 Jul 2023 13:28:23 +0000 (14:28 +0100)] 
sd-gpt: __mips__ is also defined when building __mips64

Follow-up for d75ec33ed2a1781a82f9e0d62a79244ecd1e1edc

2 years agogpt: it's __mips64, not __mips64__
Luca Boccassi [Sat, 15 Jul 2023 13:27:33 +0000 (14:27 +0100)] 
gpt: it's __mips64, not __mips64__

But it's __mips__ not __mips, obviously

Follow-up for d75ec33ed2a1781a82f9e0d62a79244ecd1e1edc

2 years agopo: Translated using Weblate (Polish)
Piotr Drąg [Sat, 15 Jul 2023 10:56:07 +0000 (12:56 +0200)] 
po: Translated using Weblate (Polish)

Currently translated at 100.0% (227 of 227 strings)

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/pl/
Translation: systemd/main

2 years agoNEWS: fix typo
Haochen Tong [Sat, 15 Jul 2023 08:41:50 +0000 (16:41 +0800)] 
NEWS: fix typo

2 years agopo: Translated using Weblate (Georgian)
Temuri Doghonadze [Sat, 15 Jul 2023 00:15:25 +0000 (02:15 +0200)] 
po: Translated using Weblate (Georgian)

Currently translated at 100.0% (227 of 227 strings)

po: Translated using Weblate (Georgian)

Currently translated at 97.3% (221 of 227 strings)

po: Translated using Weblate (Georgian)

Currently translated at 94.2% (214 of 227 strings)

po: Translated using Weblate (Georgian)

Currently translated at 90.3% (205 of 227 strings)

po: Translated using Weblate (Georgian)

Currently translated at 88.9% (202 of 227 strings)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ka/
Translation: systemd/main

2 years agoUpdate NEWS for v254-rc2 v254-rc2
Luca Boccassi [Sat, 15 Jul 2023 00:18:12 +0000 (01:18 +0100)] 
Update NEWS for v254-rc2

Liberté, égalité, releasé 🇫🇷

2 years agoMerge pull request #28405 from bluca/rc2
Luca Boccassi [Sat, 15 Jul 2023 00:15:41 +0000 (01:15 +0100)] 
Merge pull request #28405 from bluca/rc2

RC2 busywork

2 years agoUpdate NEWS with latest changes 28405/head
Luca Boccassi [Fri, 14 Jul 2023 22:45:00 +0000 (23:45 +0100)] 
Update NEWS with latest changes

2 years agoNEWS: update contributors list
Luca Boccassi [Fri, 14 Jul 2023 22:45:47 +0000 (23:45 +0100)] 
NEWS: update contributors list

2 years agoUpdate hwdb
Luca Boccassi [Fri, 14 Jul 2023 22:40:49 +0000 (23:40 +0100)] 
Update hwdb

2 years agopo: Translated using Weblate (Georgian)
Temuri Doghonadze [Fri, 14 Jul 2023 22:01:09 +0000 (00:01 +0200)] 
po: Translated using Weblate (Georgian)

Currently translated at 94.2% (214 of 227 strings)

po: Translated using Weblate (Georgian)

Currently translated at 90.3% (205 of 227 strings)

po: Translated using Weblate (Georgian)

Currently translated at 88.9% (202 of 227 strings)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ka/
Translation: systemd/main