]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
2 years agopid1: allowlist all tpm devices for a unit when encrypted creds are needed 26953/head
Lennart Poettering [Thu, 23 Mar 2023 17:22:43 +0000 (18:22 +0100)] 
pid1: allowlist all tpm devices for a unit when encrypted creds are needed

We might be configured to use some ther device than /dev/tpmrm0, hence
allow them all by allowlisting the tpm char device class as a whole.

2 years agocore: move encrypted credential check to execute.c
Lennart Poettering [Thu, 23 Mar 2023 12:58:34 +0000 (13:58 +0100)] 
core: move encrypted credential check to execute.c

This is an operation on an ExecContext, hence it probably should be
placed there.

2 years agoMerge pull request #26214 from YHNdnzj/sd-notify-change-notifyaccess
Mike Yuan [Thu, 23 Mar 2023 16:11:29 +0000 (00:11 +0800)] 
Merge pull request #26214 from YHNdnzj/sd-notify-change-notifyaccess

core: support overriding NOTIFYACCESS= through sd-notify during runtime

2 years agodocs: Explicitly tell developers to enable mkosi required meson options
Daan De Meyer [Thu, 23 Mar 2023 10:15:29 +0000 (11:15 +0100)] 
docs: Explicitly tell developers to enable mkosi required meson options

We need repart, bootctl, analyze and ukify for mkosi so let's make
sure those get built in the HACKING guide.

2 years agofind-esp: don't silently error bootctl install if presumed XBOOTLDR part is stx_dev_m...
наб [Fri, 3 Mar 2023 14:57:42 +0000 (15:57 +0100)] 
find-esp: don't silently error bootctl install if presumed XBOOTLDR part is stx_dev_major=0 but not btrfs

btrfs_get_block_device_fd() returns -ENOTTY if fstatfs().f_type !=
BTRFS_SUPER_MAGIC

btrfs_get_block_device_fd() is run by verify_fsroot_dir() by
verify_xbootldr() by find_xbootldr_and_warn() if
statx($presumed-XBOOTLDR).stx_dev_major == 0 ("maybe a btrfs device")

Every bootctl verb_install() runs find_xbootldr_and_warn(), by default
with /boot

If your /boot .stx_dev_major=0 but /not/ btrfs, bootctl install/update
quietly exits 1 with no note so as to what exactly failed (debug also
empty, and the strace isn't exactly clear since no syscall actually
failed)

This is the case on ZFS and the Debian filesystem layout: /boot/efi is
the ESP, and everything else under / is ZFS:
  $ sudo env SYSTEMD_LOG_LEVEL=debug bootctl update
  Found cgroup2 on /sys/fs/cgroup/, full unified hierarchy
  Found container virtualization none.
  File system "/boot" is not a FAT EFI System Partition (ESP) file system.
  Using EFI System Partition at /boot/efi.
  Checking whether /boot/efi/EFI/systemd/ contains any files…
  $ echo $?
  1
and funnier still:
  $ sudo bootctl update --graceful
  $ echo $?
  1

Which is great, and also breaks postinst, which runs precisely the
latter, with no feedback at all

By checking for -ENOTTY we accept that the path being investigated
"is not it" if it's on ZFS (and any other filesystem that returns
.stx_dev_major == 0 but isn't btrfs)

2 years agotest-fileio: add test for return value of read_one_line_file()
Zbigniew Jędrzejewski-Szmek [Tue, 21 Mar 2023 08:32:12 +0000 (09:32 +0100)] 
test-fileio: add test for return value of read_one_line_file()

Prompted by https://github.com/systemd/systemd/pull/26904#pullrequestreview-1349890241.

2 years agoMerge pull request #26936 from DaanDeMeyer/xopenat-lock
Daan De Meyer [Thu, 23 Mar 2023 06:49:12 +0000 (07:49 +0100)] 
Merge pull request #26936 from DaanDeMeyer/xopenat-lock

fs-util: Add xopenat_lock()

2 years agoMerge pull request #26916 from DaanDeMeyer/log-context-ref
Daan De Meyer [Wed, 22 Mar 2023 21:07:45 +0000 (22:07 +0100)] 
Merge pull request #26916 from DaanDeMeyer/log-context-ref

log: Avoid pushing the same fields more than once on the log context

2 years agofs-util: Add xopenat_lock() 26936/head
Daan De Meyer [Wed, 22 Mar 2023 16:04:36 +0000 (17:04 +0100)] 
fs-util: Add xopenat_lock()

open/create a file/directory and lock it using the given lock type.

2 years agoedit-util: alloc correct amount of memory
Mike Yuan [Wed, 22 Mar 2023 12:15:19 +0000 (20:15 +0800)] 
edit-util: alloc correct amount of memory

2 years agocoredump: use unaligned_read_ne{32,64}() to parse auxv
Yu Watanabe [Tue, 21 Mar 2023 23:49:49 +0000 (08:49 +0900)] 
coredump: use unaligned_read_ne{32,64}() to parse auxv

Fixes a bug introduced by 3e4d0f6cf99f8677edd6a237382a65bfe758de03.

The auxv metadata is unaligned, as the length of the prefix
"COREDUMP_PROC_AUXV=" is 19. Hence, parse_auxv{32,64}() may triger
an undefined behavior (or at least cause slow down), which can be
detected when running on an undefined behavior sanitizer.

This also introduces a macro to define `parse_auxv{32,64}()`.

Fixes #26912.

2 years agoukify: allow uncompressed kernel images for UNAME detection on aarch64 and riscv64...
Tobias Powalowski [Wed, 22 Mar 2023 12:24:57 +0000 (13:24 +0100)] 
ukify: allow uncompressed kernel images for UNAME detection on aarch64 and riscv64 (#26929)

Uncompressed aarch64 and riscv64 kernels have a different startpoint than x86.
Example output from ukify:
aarch64: NotImplementedError: unknown file format (starts with b'MZ@\xfa')
riscv64: NotImplementedError: unknown file format (starts with b'MZo\x10')
Add check for (b'MZ') to catch both in one call.

Fix:
https://github.com/systemd/systemd/issues/26923

2 years agocore: Settle log target if we're going to be closing all fds
Daan De Meyer [Mon, 20 Mar 2023 12:26:57 +0000 (13:26 +0100)] 
core: Settle log target if we're going to be closing all fds

Whenever we're going to close all file descriptors, we tend to close
the log and set it into open when needed mode. When this is done with
the logging target set to LOG_TARGET_AUTO, we run into issues because
for every logging call, we'll check if stderr is connected to the
journal to determine where to send the logging message. This check
obviously stops working when we close stderr, so we settle the log
target before we do that so that we keep using the same logging
target even after stderr is closed.

2 years agolabeler: add journal label also for sd-journal stuff
David Tardon [Wed, 22 Mar 2023 12:14:38 +0000 (13:14 +0100)] 
labeler: add journal label also for sd-journal stuff

2 years agotest: add tests for NOTIFYACCESS override through sd_notify 26214/head
Mike Yuan [Tue, 21 Mar 2023 19:40:52 +0000 (03:40 +0800)] 
test: add tests for NOTIFYACCESS override through sd_notify

2 years agostat-util: Add verify_regular_at()
Daan De Meyer [Tue, 14 Mar 2023 20:05:09 +0000 (21:05 +0100)] 
stat-util: Add verify_regular_at()

2 years agoMerge pull request #26829 from DaanDeMeyer/copy-at
Daan De Meyer [Wed, 22 Mar 2023 08:53:51 +0000 (09:53 +0100)] 
Merge pull request #26829 from DaanDeMeyer/copy-at

copy: Add more at() helpers

2 years agobootctl: 'graceful' should ignore EFI variable failures
Kevin P. Fleming [Tue, 21 Mar 2023 17:46:08 +0000 (13:46 -0400)] 
bootctl: 'graceful' should ignore EFI variable failures

Suppress errors when creating/writing EFI variables during 'bootctl update' if
'--graceful' mode is active (as the documentation indicates).

Closes #26773.

2 years agoMerge pull request #26928 from jamacku/update-shellcheck
Yu Watanabe [Wed, 22 Mar 2023 06:13:38 +0000 (15:13 +0900)] 
Merge pull request #26928 from jamacku/update-shellcheck

ci: trigger `differential-shellcheck` workflow on push

2 years agoci: limit permissions for `differential-shellcheck` 26928/head
Jan Macku [Wed, 22 Mar 2023 05:53:09 +0000 (06:53 +0100)] 
ci: limit permissions for `differential-shellcheck`

2 years agoci: trigger differential-shellcheck workflow on push
Jan Macku [Wed, 22 Mar 2023 05:48:08 +0000 (06:48 +0100)] 
ci: trigger differential-shellcheck workflow on push

Also update `differential-shellcheck` to latest version - https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases

Fixes: https://github.com/redhat-plumbers-in-action/differential-shellcheck/issues/215
2 years agocore: support overriding NOTIFYACCESS= through sd-notify during runtime
Mike Yuan [Thu, 26 Jan 2023 09:44:03 +0000 (17:44 +0800)] 
core: support overriding NOTIFYACCESS= through sd-notify during runtime

Closes #25963

2 years agocopy: Add more at() helpers 26829/head
Daan De Meyer [Tue, 14 Mar 2023 16:12:27 +0000 (17:12 +0100)] 
copy: Add more at() helpers

2 years agocopy: Move chattr arguments to full function signatures
Daan De Meyer [Tue, 14 Mar 2023 15:30:46 +0000 (16:30 +0100)] 
copy: Move chattr arguments to full function signatures

These are almost never used, so let's move them to the _full()
functions signatures.

2 years agoMerge pull request #26828 from DaanDeMeyer/tmpfile-at
Daan De Meyer [Tue, 21 Mar 2023 19:52:17 +0000 (20:52 +0100)] 
Merge pull request #26828 from DaanDeMeyer/tmpfile-at

tmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at()

2 years agofd-util: make sure fd_reopen() works with AT_FDCWD systematically
Lennart Poettering [Tue, 21 Mar 2023 13:34:44 +0000 (14:34 +0100)] 
fd-util: make sure fd_reopen() works with AT_FDCWD systematically

Prompted by:

https://github.com/systemd/systemd/pull/26827#pullrequestreview-1341171981

2 years agoMerge pull request #26866 from DaanDeMeyer/chase-fix
Daan De Meyer [Tue, 21 Mar 2023 19:50:48 +0000 (20:50 +0100)] 
Merge pull request #26866 from DaanDeMeyer/chase-fix

chase-symlinks: Add CHASE_FILENAME and more at() helpers

2 years agoexecute: Add kernel cmdline arguments for tty term, rows and columns
Daan De Meyer [Sun, 19 Mar 2023 10:24:01 +0000 (11:24 +0100)] 
execute: Add kernel cmdline arguments for tty term, rows and columns

Let's allow configuring tty term and size using kernel cmdline arguments
so that when running in a VM we can communicate the terminal TERM and size
from the host via SMBIOS extra kernel cmdline arguments.

2 years agodocs: Fix vscode debugging section in HACKING.md
Daan De Meyer [Tue, 21 Mar 2023 15:06:15 +0000 (16:06 +0100)] 
docs: Fix vscode debugging section in HACKING.md

Let's account for the recent changes in mkosi in the debugging
with vscode section.

2 years agochase-symlinks: Add more chase_symlinks_at() helpers 26866/head
Daan De Meyer [Tue, 14 Mar 2023 13:03:28 +0000 (14:03 +0100)] 
chase-symlinks: Add more chase_symlinks_at() helpers

Copies of the corresponding chase_symlinks() helpers.

2 years agochase-symlinks: Return zero from access() and stat() helpers
Daan De Meyer [Fri, 17 Mar 2023 09:06:13 +0000 (10:06 +0100)] 
chase-symlinks: Return zero from access() and stat() helpers

We never check if r > 0 when using these helpers, so let's just
return zero like we usually do.

2 years agochase-symlinks: Add CHASE_EXTRACT_FILENAME flag
Daan De Meyer [Tue, 14 Mar 2023 17:37:55 +0000 (18:37 +0100)] 
chase-symlinks: Add CHASE_EXTRACT_FILENAME flag

Useful in combination with CHASE_PARENT to get a directory file
descriptor to the parent directory of the resolved path and the
filename of the resolved path in the parent directory (which might
not be the same as the filename of the input path because of symlinks).

2 years agoudev-rules: fix nvme symlink creation on namespace changes
Thomas Blume [Thu, 2 Mar 2023 11:06:13 +0000 (12:06 +0100)] 
udev-rules: fix nvme symlink creation on namespace changes

The nvme by-id symlink changes to the latest namespace when a new namespace gets
added, for example by connecting multiple NVMe/TCP host controllers via nvme
connect-all.
That is incorrect for persistent device links.
The persistent symbolic device link should continue to point to the same NVMe
namespace throughout the lifetime of the current boot.
Therefore the namespace id needs to be added to the link name.

2 years agotmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at() 26828/head
Daan De Meyer [Tue, 14 Mar 2023 16:12:06 +0000 (17:12 +0100)] 
tmpfile-util: Add open_tmpfile_linkable_at() and link_tmpfile_at()

2 years agofs-util: Add open_parent_at()
Daan De Meyer [Tue, 14 Mar 2023 16:10:48 +0000 (17:10 +0100)] 
fs-util: Add open_parent_at()

2 years agolock-util: Add make_lock_file_at()
Daan De Meyer [Thu, 9 Mar 2023 11:59:09 +0000 (12:59 +0100)] 
lock-util: Add make_lock_file_at()

2 years agounit: Add LOG_CONTEXT_PUSH_UNIT() 26916/head
Daan De Meyer [Tue, 21 Mar 2023 13:57:29 +0000 (14:57 +0100)] 
unit: Add LOG_CONTEXT_PUSH_UNIT()

A helper macro to push all unit related fields onto the log context.
We also modify exec_spawn() to use it.

2 years agolog: Add key/value support to the log context
Daan De Meyer [Tue, 21 Mar 2023 13:51:56 +0000 (14:51 +0100)] 
log: Add key/value support to the log context

Now that we have reference counting, it's useful to be able to push
single key values onto the log context separately, so that we don't
have to allocate new storage to join the separate string together into
a single field which means we won't be able to reuse a context containing
the same field.

2 years agolog: Avoid pushing the same fields more than once on the log context
Daan De Meyer [Tue, 21 Mar 2023 13:06:21 +0000 (14:06 +0100)] 
log: Avoid pushing the same fields more than once on the log context

Let's try to optimize against pushing the same fields multiple times
onto the log context. To achieve this we make the log context reference
counted and return an existing context object if it's using the same
fields.

A consequence of this is that we have to make sure attaching/detaching
is coupled to the lifetime of the context object, so we make the attach
and detach functions private for now. If we need independent attach/detach
in the future, we can make that work with some extra complexity but since
we don't need it yet, let's not support it for now.

2 years agoMerge pull request #26893 from yuwata/uki-util-update-log
Yu Watanabe [Tue, 21 Mar 2023 10:06:18 +0000 (19:06 +0900)] 
Merge pull request #26893 from yuwata/uki-util-update-log

util: rename uki-util.[ch] -> kernel-image.[ch]

2 years agomkosi: Default to debug log level for udev as well
Daan De Meyer [Tue, 21 Mar 2023 09:01:09 +0000 (10:01 +0100)] 
mkosi: Default to debug log level for udev as well

Unlike CI, the debug output just goes to the journal, so there's no
harm in enabling it, even if it's noisy.

2 years agoman/network-generator: replace dracut.kernel reference with dracut.cmdline
Antonio Alvarez Feijoo [Tue, 21 Mar 2023 08:09:24 +0000 (09:09 +0100)] 
man/network-generator: replace dracut.kernel reference with dracut.cmdline

`dracut.kernel.7` is just a symlink to `dracut.cmdline.7`, so the web reference
points to a non-existent URL
(https://man7.org/linux/man-pages/man7/dracut.kernel.7.html).

2 years agogpt-auto-generator: fix typo
Antonio Alvarez Feijoo [Tue, 21 Mar 2023 08:43:15 +0000 (09:43 +0100)] 
gpt-auto-generator: fix typo

2 years agoMerge pull request #26867 from dtardon/list-dependencies-circular
Zbigniew Jędrzejewski-Szmek [Tue, 21 Mar 2023 08:40:46 +0000 (09:40 +0100)] 
Merge pull request #26867 from dtardon/list-dependencies-circular

Fix printing of circular dependencies

2 years agoutil: rename uki-util.[ch] -> kernel-image.[ch] 26893/head
Yu Watanabe [Tue, 21 Mar 2023 07:49:23 +0000 (16:49 +0900)] 
util: rename uki-util.[ch] -> kernel-image.[ch]

As the file contains functions not only for UKI.

2 years agouki-util: rename KernelType -> KernelImageType
Yu Watanabe [Tue, 21 Mar 2023 07:44:50 +0000 (16:44 +0900)] 
uki-util: rename KernelType -> KernelImageType

The name KernelType is slightly ambiguous. The type is about kernel
image. Let's rename the enum to clarify that.

2 years agouki-util: rename uki -> f
Yu Watanabe [Tue, 21 Mar 2023 07:40:36 +0000 (16:40 +0900)] 
uki-util: rename uki -> f

As the function is not only for UKI.

2 years agouki-util: update log messages
Yu Watanabe [Sun, 19 Mar 2023 15:01:40 +0000 (00:01 +0900)] 
uki-util: update log messages

2 years agoudev-rules: add another check for conflicting expressions
Dmitry V. Levin [Mon, 20 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: add another check for conflicting expressions

Log an error when a rule line contains the following kind of conflicting
match expressions:

  KEY=="foo", KEY=="bar"

2 years agocompare-operator: added unit tests
OMOJOLA JOSHUA DAMILOLA [Sun, 19 Mar 2023 16:11:15 +0000 (16:11 +0000)] 
compare-operator: added unit tests

2 years agoMerge pull request #26875 from yuwata/core-transaction
Yu Watanabe [Mon, 20 Mar 2023 15:42:30 +0000 (00:42 +0900)] 
Merge pull request #26875 from yuwata/core-transaction

core/transaction: several fixes for merge_unit_ids()

2 years agostrv: introduce strv_print_full()
Yu Watanabe [Sun, 19 Mar 2023 14:32:43 +0000 (23:32 +0900)] 
strv: introduce strv_print_full()

2 years agoci: drop clang-13, add clang-16
Frantisek Sumsal [Sun, 19 Mar 2023 20:37:40 +0000 (21:37 +0100)] 
ci: drop clang-13, add clang-16

2 years agobootctl: fix wrong type comparison
Yu Watanabe [Sun, 19 Mar 2023 19:37:49 +0000 (04:37 +0900)] 
bootctl: fix wrong type comparison

2 years agoMerge pull request #26886 from ldv-alt/udevadm-verify
Yu Watanabe [Mon, 20 Mar 2023 04:58:08 +0000 (13:58 +0900)] 
Merge pull request #26886 from ldv-alt/udevadm-verify

udev-rules: fix matching of token types that support alternative patterns

2 years agoloop-util: add more debugging logs in loop_configure()
Yu Watanabe [Sun, 19 Mar 2023 07:39:15 +0000 (16:39 +0900)] 
loop-util: add more debugging logs in loop_configure()

2 years agoudev-rules: fix check for conflicting and duplicate expressions 26886/head
Dmitry V. Levin [Fri, 17 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: fix check for conflicting and duplicate expressions

Fix check for conflicting and duplicate expressions of types that
support alternative patterns.

Fixes: 3ec58d0cd8f6 ("udev-rules: check for conflicting and duplicate expressions")
2 years agoRevert "udev: prepare memory for extra NUL termination for NULSTR"
Dmitry V. Levin [Sun, 19 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
Revert "udev: prepare memory for extra NUL termination for NULSTR"

This reverts commit cd3c8a117ccf3505e49d34324473e2175ef0a9ce which was
papering over the bug instead of a proper fix made by the previous
commit.

2 years agoudev-rules: fix matching of token types that support alternative patterns
Dmitry V. Levin [Thu, 16 Mar 2023 08:00:00 +0000 (08:00 +0000)] 
udev-rules: fix matching of token types that support alternative patterns

For those token types that support matching of alternative patterns,
their token values are interpreted as nulstr, so make sure the parser
does the right thing and makes these token values terminated by two
subsequent NULs so they could be safely interpreted as nulstr.

Before this fix, the following rules would result to "echo foo" invocation:
  ENV{foo}=", RUN"
  ENV{foo}=="bar", RUN+="echo foo"
because the value of `ENV{foo}` is treated as nulstr, and it used to match
against alternative patterns, in this case `bar`, `, RUN`, and `="echo foo`.

Fixes: 25de7aa7b90c ("udev: modernize udev-rules.c")
2 years agohwdb: fix Wifi toggling for Haier 7G-Series/JWU (#25293) (#26878)
taniishkaaa [Sun, 19 Mar 2023 05:16:00 +0000 (10:46 +0530)] 
hwdb: fix Wifi toggling for Haier 7G-Series/JWU (#25293) (#26878)

2 years agoMerge pull request #26884 from YHNdnzj/tmpfiles-unit-name-update
Yu Watanabe [Sun, 19 Mar 2023 03:18:10 +0000 (12:18 +0900)] 
Merge pull request #26884 from YHNdnzj/tmpfiles-unit-name-update

Update references to obsolete systemd-tmpfiles.service

2 years agoMerge pull request #26880 from yuwata/test-tmpfiles
Yu Watanabe [Sat, 18 Mar 2023 17:49:11 +0000 (02:49 +0900)] 
Merge pull request #26880 from yuwata/test-tmpfiles

tmpfiles: cleanups

2 years agoMerge pull request #26879 from mrc0mmand/cocci
Yu Watanabe [Sat, 18 Mar 2023 17:48:39 +0000 (02:48 +0900)] 
Merge pull request #26879 from mrc0mmand/cocci

tree-wide: simplify x ? x : y to x ?: y where applicable

2 years agodocs: update unit name for sd-tmpfiles-setup 26884/head
Mike Yuan [Sat, 18 Mar 2023 17:32:50 +0000 (01:32 +0800)] 
docs: update unit name for sd-tmpfiles-setup

2 years agounit: sysext: update unit name for sd-tmpfiles-setup
Mike Yuan [Sat, 18 Mar 2023 17:29:48 +0000 (01:29 +0800)] 
unit: sysext: update unit name for sd-tmpfiles-setup

Fixes #26882

2 years agotest-systemd-tmpfiles.py: create global temporary directory 26880/head
Yu Watanabe [Sat, 18 Mar 2023 13:24:53 +0000 (22:24 +0900)] 
test-systemd-tmpfiles.py: create global temporary directory

For some unknown reasons, the temporary directory created by the test
below is not removed:
```
 # Test the case that a valid symlink is in the path.
 label = 'valid_symlink-deep'
 test_content('f= {} - - - - ' + label, label, user=user, subpath='/deep/1/2', path_cb=valid_symlink)
```
To keep /tmp clean, let's create the global temprary directory.

2 years agotest-systemd-tmpfiles.py: use test_content() at one more place
Yu Watanabe [Sat, 18 Mar 2023 13:20:49 +0000 (22:20 +0900)] 
test-systemd-tmpfiles.py: use test_content() at one more place

2 years agotmpfiles: show file type in octal, instead of hex
Yu Watanabe [Sat, 18 Mar 2023 13:00:34 +0000 (22:00 +0900)] 
tmpfiles: show file type in octal, instead of hex

2 years agotree-wide: simplify x ? x : y to x ?: y where applicable 26879/head
Frantisek Sumsal [Sat, 18 Mar 2023 12:58:27 +0000 (13:58 +0100)] 
tree-wide: simplify x ? x : y to x ?: y where applicable

2 years agococcinelle: add a transformation for GNU conditionals
Frantisek Sumsal [Sat, 18 Mar 2023 12:56:38 +0000 (13:56 +0100)] 
coccinelle: add a transformation for GNU conditionals

i.e. x ? x : y => x ?: y

2 years agococcinelle: respect spacing from the semantic patch
Frantisek Sumsal [Sat, 18 Mar 2023 12:52:28 +0000 (13:52 +0100)] 
coccinelle: respect spacing from the semantic patch

2 years agoman: explicitly list three command syntax at the beginning
Yu Watanabe [Sat, 18 Mar 2023 06:51:37 +0000 (15:51 +0900)] 
man: explicitly list three command syntax at the beginning

2 years agoMerge pull request #26759 from medhefgo/boot-stack-protector
Yu Watanabe [Sat, 18 Mar 2023 06:07:45 +0000 (15:07 +0900)] 
Merge pull request #26759 from medhefgo/boot-stack-protector

boot: Add support for stack protector/trapping math/ubsan

2 years agounits: Order user@.service after systemd-oomd.service
Daan De Meyer [Fri, 17 Mar 2023 12:07:56 +0000 (13:07 +0100)] 
units: Order user@.service after systemd-oomd.service

The user manager connects to oomd over varlink. Currently, during
shutdown, if oomd is stopped before any user manager, the user
manager will try to reconnect to the socket, leading to a warning
from pid 1 about a conflicting transaction.

Let's fix this by ordering user@.service after systemd-oomd.service,
so that user sessions are stopped before systemd-oomd is stopped,
which makes sure that the user sessions won't try to start oomd via
its socket after systemd-oomd is stopped.

2 years agoMerge pull request #26862 from yuwata/uki-util
Yu Watanabe [Sat, 18 Mar 2023 06:04:54 +0000 (15:04 +0900)] 
Merge pull request #26862 from yuwata/uki-util

uki-util: export functions of inspecting kernel

2 years agoMerge pull request #26861 from yuwata/exec-util
Yu Watanabe [Sat, 18 Mar 2023 06:04:16 +0000 (15:04 +0900)] 
Merge pull request #26861 from yuwata/exec-util

exec-util: introduce execute_strv() and EXEC_DIR_SKIP_REMAINING

2 years agoMerge pull request #26855 from DaanDeMeyer/repart-fixes
Yu Watanabe [Sat, 18 Mar 2023 06:03:38 +0000 (15:03 +0900)] 
Merge pull request #26855 from DaanDeMeyer/repart-fixes

Repart fixes

2 years agocore/transaction: do not log "(null)" 26875/head
Yu Watanabe [Sat, 18 Mar 2023 03:15:10 +0000 (12:15 +0900)] 
core/transaction: do not log "(null)"

As we ignores the failure in merge_unit_ids(), so unit_ids may be NULL.

2 years agocore/transaction: make merge_unit_ids() return non-NULL on success
Yu Watanabe [Sat, 18 Mar 2023 03:17:54 +0000 (12:17 +0900)] 
core/transaction: make merge_unit_ids() return non-NULL on success

2 years agocore/transaction: make merge_unit_ids() always return NUL-terminated string
Yu Watanabe [Sat, 18 Mar 2023 03:12:01 +0000 (12:12 +0900)] 
core/transaction: make merge_unit_ids() always return NUL-terminated string

Follow-up for 924775e8ce49817f96df19c2b06356c12ecfc754.

The loop run with `STRV_FOREACH_PAIR()`, hence `if (*(unit_id+1))` is
not a good way to detect if there exist a next entry.

Fixes #26872.

2 years agoMerge pull request #26863 from yuwata/kernel-install-cleanups
Mike Yuan [Fri, 17 Mar 2023 18:28:50 +0000 (02:28 +0800)] 
Merge pull request #26863 from yuwata/kernel-install-cleanups

kernel-install: cleanups

2 years agosleep: fix default values unmatched with manual
Mike Yuan [Fri, 17 Mar 2023 07:13:56 +0000 (15:13 +0800)] 
sleep: fix default values unmatched with manual

2 years agoMerge pull request #26871 from weblate/weblate-systemd-master
Mike Yuan [Fri, 17 Mar 2023 18:22:54 +0000 (02:22 +0800)] 
Merge pull request #26871 from weblate/weblate-systemd-master

Translations update from Fedora Weblate

2 years agopo: Translated using Weblate (Bulgarian) 26871/head
Velislav Ivanov [Fri, 17 Mar 2023 15:20:30 +0000 (16:20 +0100)] 
po: Translated using Weblate (Bulgarian)

Currently translated at 100.0% (193 of 193 strings)

Co-authored-by: Velislav Ivanov <velislav.bg@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/bg/
Translation: systemd/main

2 years agosystemctl: move printing of state to the printing func. 26867/head
David Tardon [Fri, 17 Mar 2023 09:43:54 +0000 (10:43 +0100)] 
systemctl: move printing of state to the printing func.

No functional change, just refactoring.

2 years agokernel-install: check all entry candidates first, then check existence of $pref/loade... 26863/head
Yu Watanabe [Thu, 16 Mar 2023 04:33:28 +0000 (13:33 +0900)] 
kernel-install: check all entry candidates first, then check existence of $pref/loader/entries only once

If we have multiple entries in $ENTRY_TOKEN_SEARCH, and $pref/loader/entries
exists, then previously we would always exit after the first candidate and
ignore the second and later candidates.

Follow-up for 1b43f868934e971480249a6e0fa2f45da906ea2e.

2 years agoRevert "kernel-install: also try to find $BOOT by partition GUID"
Yu Watanabe [Thu, 16 Mar 2023 04:26:18 +0000 (13:26 +0900)] 
Revert "kernel-install: also try to find $BOOT by partition GUID"

This reverts commit 41f39e2144c935868059e894c1a1e13803e3568f.

From the post merge comment in #26648:

> Hmm, this is highly problematic, no? if I boot from my ssd and then
> plug in a fedora live usb stick, then there will be two ESPs around,
> the one from my ssd and the one from the live usb one, and this code
> might find the wrong one and bad things will happen

2 years agouki-util: move functions for inspecting kernel to uki-util.[ch] 26862/head
Yu Watanabe [Fri, 17 Mar 2023 05:20:29 +0000 (14:20 +0900)] 
uki-util: move functions for inspecting kernel to uki-util.[ch]

2 years agobootctl: introduce inspect_kernel()
Yu Watanabe [Fri, 17 Mar 2023 05:32:54 +0000 (14:32 +0900)] 
bootctl: introduce inspect_kernel()

Then, now verb_kernel_identify() and verb_kernel_inspect() can share
most of the code.

2 years agobootctl: introduce uki_read_pretty_name()
Yu Watanabe [Fri, 17 Mar 2023 11:19:04 +0000 (20:19 +0900)] 
bootctl: introduce uki_read_pretty_name()

No functional change, just prepration for later commits.

2 years agobootctl: find matching section in read_pe_section()
Yu Watanabe [Fri, 17 Mar 2023 11:14:43 +0000 (20:14 +0900)] 
bootctl: find matching section in read_pe_section()

No functional change, just refactoring.

2 years agobootctl: return 0 instead of EXIT_SUCCESS
Yu Watanabe [Fri, 17 Mar 2023 05:26:14 +0000 (14:26 +0900)] 
bootctl: return 0 instead of EXIT_SUCCESS

2 years agobootctl: move verb_kernel_identity()
Yu Watanabe [Fri, 17 Mar 2023 05:21:56 +0000 (14:21 +0900)] 
bootctl: move verb_kernel_identity()

No functional change, just for making beautify later diffs.

2 years agoos-util: add missing headers
Yu Watanabe [Wed, 15 Mar 2023 22:51:09 +0000 (07:51 +0900)] 
os-util: add missing headers

For 'bool' and 'usec_t'.

2 years agoexec-util: introduce EXEC_DIR_SKIP_REMAINING flag 26861/head
Yu Watanabe [Thu, 16 Mar 2023 02:34:14 +0000 (11:34 +0900)] 
exec-util: introduce EXEC_DIR_SKIP_REMAINING flag

Will be used in later commits.

2 years agoexec-util: extract the core logic of execute_directories() as execute_strv()
Yu Watanabe [Thu, 16 Mar 2023 02:16:51 +0000 (11:16 +0900)] 
exec-util: extract the core logic of execute_directories() as execute_strv()

Then, we can use it with a custom enumerator of executables.

No functional change, preparation for later commits.

2 years agoexec-util: enumerate executables earlier
Yu Watanabe [Fri, 17 Mar 2023 03:59:40 +0000 (12:59 +0900)] 
exec-util: enumerate executables earlier

Then, return earlier if no executable found.

2 years agoexec-util: drop meaningless casts
Yu Watanabe [Fri, 17 Mar 2023 03:56:05 +0000 (12:56 +0900)] 
exec-util: drop meaningless casts

2 years agoexec-util: tighten variable scope a bit
Yu Watanabe [Fri, 17 Mar 2023 03:46:51 +0000 (12:46 +0900)] 
exec-util: tighten variable scope a bit

2 years agoMerge pull request #26849 from DaanDeMeyer/fwd-colors
Daan De Meyer [Fri, 17 Mar 2023 11:02:35 +0000 (12:02 +0100)] 
Merge pull request #26849 from DaanDeMeyer/fwd-colors

journald-console: Add colors when forwarding to console