Daan De Meyer [Fri, 24 Mar 2023 13:30:16 +0000 (14:30 +0100)]
core: Move DynamicCreds into ExecRuntime
This is just another piece of runtime data so let's store it in
ExecRuntime alongside the other runtime data.
Daan De Meyer [Thu, 9 Mar 2023 14:10:23 +0000 (15:10 +0100)]
core: Introduce unit private exec runtime
Currently, exec runtimes can be shared between units (using
JoinsNamespaceOf=). Let's introduce a concept of a private exec
runtime that isn't shared with JoinsNamespaceOf=. The existing
ExecRuntime struct is renamed to ExecRuntimeShared and becomes a
private member of the new private ExecRuntime.
Daan De Meyer [Mon, 27 Mar 2023 12:32:58 +0000 (14:32 +0200)]
execute: Do not pass destroy as a boolean argument to unref()
Let's mimick what we do for DynamicUser and have two separate functions
for unreffing and destroying a ExecSharedRuntime object.
Daan De Meyer [Sun, 26 Mar 2023 18:07:36 +0000 (20:07 +0200)]
execute: Rename ExecRuntime to ExecSharedRuntime
Preparation for next commit
Daan De Meyer [Mon, 27 Mar 2023 11:23:40 +0000 (13:23 +0200)]
mkosi: Narrow glob used to install python packages
Let's make sure we only install the python3 and python39 python
packages, instead of all the packages of all versions that are
packaged.
This also fixes the CentOS 8 CI because python3.11-pytest was failing
to install.
We have to ship our own powertools repo definition because we need to
enable module_hotfixes for powertools to coerce dnf into installing
some of the python packages.
Lennart Poettering [Mon, 27 Mar 2023 11:20:11 +0000 (13:20 +0200)]
update TODO
Frantisek Sumsal [Sun, 26 Mar 2023 15:04:57 +0000 (17:04 +0200)]
test: verify the journal with and without a sealing key
The bit flips during journal verification cause various types of journal
corruptions, so it's useful to go through it even without a sealing key
to see how we handle corrupted stuff.
Also, provide a sealing key if running in "CI mode" (i.e. arguments),
to check the FSS-related codepaths in CIs as well.
Yu Watanabe [Sun, 26 Mar 2023 05:03:10 +0000 (14:03 +0900)]
sd-id128: make id128_read() optionally take root directory
Daan De Meyer [Mon, 27 Mar 2023 08:41:08 +0000 (10:41 +0200)]
Merge pull request #26961 from DaanDeMeyer/chase-and-pin
chase-symlinks: Add chase_and_open_parent() + at() variant
Luca Boccassi [Mon, 27 Mar 2023 08:38:15 +0000 (09:38 +0100)]
Merge pull request #26870 from fbuihuu/move-unit-tests-in-a-dedicated-subdir
Move unit tests in a dedicated subdir
Mike Yuan [Thu, 23 Mar 2023 14:17:40 +0000 (22:17 +0800)]
journalctl: fix when --grep is used with --follow
Follow-up for #25147 (
db4691961ca52759fe6645d0fddb659ee4299ac2)
--follow sets arg_lines to 10, which breaks
--grep as the latter implies --reverse.
So let's not set --reverse if --follow is used.
Zbigniew Jędrzejewski-Szmek [Mon, 27 Mar 2023 08:26:24 +0000 (10:26 +0200)]
Merge pull request #26294 from yuwata/locale-verify-conf
locale: verify loaded keymap or friends
Yu Watanabe [Sun, 26 Mar 2023 07:33:43 +0000 (16:33 +0900)]
bootctl: split-out entry token related definitions into boot-entry.[ch]
No functional change, just preparation for later commits.
These can be used in kernel-install later.
Note, unlike the our usual coding style, the arguments for
boot_entry_token_ensure() and parse_boot_entry_token_type() are
referenced, updated, and may freed, hence, always pass initialized
values. That's why they are not named as 'ret_xyz'.
Daan De Meyer [Fri, 24 Mar 2023 11:10:16 +0000 (12:10 +0100)]
chase-symlinks: Add chase_and_open_parent() + at() variant
Helper to chase a path, pin its parent directory and return the filename
of the resolved path in its parent directory.
Gertalitec [Wed, 22 Mar 2023 21:09:10 +0000 (01:09 +0400)]
Define $KERNEL_INSTALL_UKI_GENERATOR
Define $KERNEL_INSTALL_UKI_GENERATOR in case one wants it to be different from $KERNEL_INSTALL_INITRD_GENERATOR. This can be useful if one wants to use mkinitcpio / Dracut to generate the initrd, but without creating the UKI so this can be left for e.g. ukify or something else. Right now these initrd generators will read /etc/kernel/install.conf and generate the UKI
taniishkaaa [Sun, 26 Mar 2023 14:52:31 +0000 (20:22 +0530)]
hwdb: Fixed thumb buttons reversed on CHERRY MW 2310 (#26992)
Fixes #12914.
Yu Watanabe [Sun, 26 Mar 2023 00:44:48 +0000 (09:44 +0900)]
hwdb: drop redundant entry
Follow-up for
ff155c81620bc4e1ccce27d4d5194707048d8143.
The entry already matches with the generic rule defined at the beginning
of the hwdb file.
Franck Bui [Fri, 24 Mar 2023 12:46:24 +0000 (13:46 +0100)]
test: install symlinks with valid targets on SUSE and Debian
Yu Watanabe [Sun, 26 Mar 2023 00:49:27 +0000 (09:49 +0900)]
Merge pull request #26973 from mrc0mmand/userdbctl-tests
test: add a couple of tests for userdbctl
Zbigniew Jędrzejewski-Szmek [Sat, 25 Mar 2023 10:58:49 +0000 (11:58 +0100)]
core/main: restore the correct assert about array position
'pos' is incremented after each assignment. If we use the maximum number
of arguments, we end up with pos==9 after all the assignments, and it
points to where the next value would be assigned. This position must remain
NULL.
The assert I "fixed" was intentionally introduced in
26abdc73a212b90f7c4b71808a1028d2e87ab09f as a bugfix. So my "fix" repeated
the same error that was fixed back then.
Yu Watanabe [Sun, 26 Mar 2023 00:47:49 +0000 (09:47 +0900)]
Merge pull request #26983 from mrc0mmand/coredump-test-followup
test: don't expand the subshell expression prematurely
Frantisek Sumsal [Sat, 25 Mar 2023 13:39:13 +0000 (14:39 +0100)]
test: filter the merged coverage report instead
So we don't have to do this twice - once for the base report and then
for each "real" one.
Follow-up to
7fdd6e157a.
Frantisek Sumsal [Fri, 24 Mar 2023 16:26:48 +0000 (17:26 +0100)]
test: add a couple of tests for userdbctl
Frantisek Sumsal [Fri, 24 Mar 2023 20:15:28 +0000 (21:15 +0100)]
test: do an initial coverage capture
I noticed that our coverage reports miss some files completely - this
happens when the test doesn't touch the code in them at all, so the
generated coverage data (and resulting reports) have no information
about them. Let's fix this by doing an initial zero coverage capture
that contains a zeroed counter for every instrumented line in every
file, so when we later merge it with a capture from the test, it shows up
with a missing coverage instead of not showing at all.
Frantisek Sumsal [Sat, 25 Mar 2023 11:17:11 +0000 (12:17 +0100)]
test: drop unnecessary return
Return code of the EXIT trap handler is ignored in bash.
Frantisek Sumsal [Sat, 25 Mar 2023 11:15:33 +0000 (12:15 +0100)]
test: don't touch the /failed marker in the subtest scripts
As it is already handled by the "main" script (testsuite-74.sh).
Frantisek Sumsal [Sat, 25 Mar 2023 11:02:15 +0000 (12:02 +0100)]
test: don't expand the subshell expression prematurely
We need to expand the subshell expression during the `bash -c`
invocation, not before, to take the desired effect, as now it expands to:
timeout 30 bash -c 'while [[ 0 -eq 0 ]]; do sleep 1; done'
instead of the expected:
timeout 30 bash -c 'while [[ $(coredumpctl list -q --no-legend 770 | wc -l) -eq 0 ]]; do sleep 1; done'
Follow-up to
aadbd81f7f.
taniishkaaa [Sat, 25 Mar 2023 10:41:07 +0000 (16:11 +0530)]
hwdb: Fix incorrect touchpad dimensions on Thinkpad L14 Gen1 (#26937)
Closes #22793.
Yu Watanabe [Wed, 1 Feb 2023 19:29:43 +0000 (04:29 +0900)]
test: add test for invalid keymap setting
Yu Watanabe [Wed, 1 Feb 2023 18:23:50 +0000 (03:23 +0900)]
locale: also verify keymaps loaded from config file and converted keymaps
If vconsole.conf or friends contain an invalid keymap, then let's
ignore the settings.
Yu Watanabe [Wed, 1 Feb 2023 17:53:35 +0000 (02:53 +0900)]
locale: introduce x11_context_verify()
No functional change, preparation for later commits.
Yu Watanabe [Wed, 1 Feb 2023 17:47:47 +0000 (02:47 +0900)]
locale: split out xkbcommon related functions to xkbcommon-util.c
Then, use dlopen_many_sym_or_warn() with DLSYM_ARG() macro.
Yu Watanabe [Wed, 1 Feb 2023 16:50:37 +0000 (01:50 +0900)]
locale: split out checking existence of keymap
No functional change, preparation for later commits.
Yu Watanabe [Wed, 1 Feb 2023 16:34:24 +0000 (01:34 +0900)]
locale: move x11_convert_to_vconsole() near the relevant functions
No functional changes, just refactoring.
Yu Watanabe [Sat, 25 Mar 2023 04:39:27 +0000 (13:39 +0900)]
Merge pull request #26960 from poettering/syscall-catchup
syscall filter group updates
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:51:52 +0000 (17:51 +0100)]
xdg-autostart-generator: do not warn about unknown fields
My user manager says:
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:256: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:258: Unknown section 'Desktop Action new-window'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.gnome.Terminal.desktop:343: Unknown section 'Desktop Action preferences'. Ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:12: Unknown key name 'Actions' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:13: Unknown key name 'SingleMainWindow' in section 'Desktop Entry', ignoring.
systemd-xdg-autostart-generator[2933]: /home/zbyszek/.config/autostart/org.telegram.desktop.desktop:19: Unknown section 'Desktop Action Quit'. Ignoring.
This is not useful. Those are externally-provided files, and they are likely to
have entries which we know nothing about.
Yu Watanabe [Sat, 25 Mar 2023 04:38:24 +0000 (13:38 +0900)]
Merge pull request #26977 from poettering/find-line-startswith
add new find_line_startswith() helper
Yu Watanabe [Fri, 24 Mar 2023 21:58:35 +0000 (06:58 +0900)]
bootctl: enable colored logging
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 13:11:48 +0000 (14:11 +0100)]
core/main: fix setting of arguments for shutdown
Fixup for
d2ebd50d7f9740dcf30e84efc75610af173967d2
and
6920049fad4fa39db5fec712f82f7f75b98fd4b9:
- add a comment that the last arg must be NULL and adjust the assert.
- move initialization around so that fields are declared,
initialized, and consumed in the same order.
- move declaration of pos adjacent do declaration of command_line.
This makes it easy to see that it was not initialized correctly.
- initialize buffers before writing the pointer into the args array.
This makes no difference for the compiler, but it just feels "wrong"
to do it in opposite order.
Because pos was off, we would ignore args after the timeout, and also
overwrite the buffer if enough args were used.
I think this is case shows clearly that declaring all variables at the
top of the function, with some initialized and other not, is very
error-prone. The compiler has no issue with declaring variables whereever,
and we should take advantage of this to make it keep declaration,
initialization, and use close. (Within reason of course.)
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 13:54:34 +0000 (14:54 +0100)]
tools: add dump-auxv.py
This is a little helper I used when preparing the tests for auxv
parsing. Just looking at hexdump output is pretty hard. We could
enhance it to display some specific data types better.
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:25:59 +0000 (17:25 +0100)]
hwdb: drop boilerplate about match patterns in two more cases
Follow-up for
adbe000e3df5f91572bf4a77a2acd84ff5b87320.
Somehow I missed those two files.
Lennart Poettering [Fri, 24 Mar 2023 17:27:03 +0000 (18:27 +0100)]
import: use truncate_nl() where appropriate
Lennart Poettering [Fri, 24 Mar 2023 17:25:13 +0000 (18:25 +0100)]
tree-wide: port various places to find_line_startswith()
Lennart Poettering [Fri, 24 Mar 2023 17:02:32 +0000 (18:02 +0100)]
string-util: add new helper for finding line starting with specific string in a text buffer
We have implemented this manually a couple of times, and always wrong.
Hence let's implement this correctly for once and use everywhere.
Frantisek Sumsal [Fri, 24 Mar 2023 16:17:31 +0000 (17:17 +0100)]
userdbctl: flush stdout before running the chain command
Otherwise it's quite difficult to capture the entire output:
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello
ssh-
ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIA//dxI2xLg4MgxIKKZv1nqwTEIlE/fdakii2Fb75pG+ foo@bar.tld
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMlaqG2rTMje5CQnfjXJKmoSpEVJ2gWtx4jBvsQbmee2XbU/Qdq5+SRisssR9zVuxgg5NA5fv08MgjwJQMm+csc= hello@world.tld
hello
$ userdbctl ssh-authorized-keys dropinuser --chain /bin/echo hello | tee
hello
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 16:00:31 +0000 (17:00 +0100)]
Merge pull request #26920 from medhefgo/ukify
ukify: Use pefile to add sections to EFI stub
Frantisek Sumsal [Fri, 24 Mar 2023 15:16:50 +0000 (16:16 +0100)]
docs: s/authorized_key/authorized_keys/
Frantisek Sumsal [Fri, 24 Mar 2023 14:43:04 +0000 (15:43 +0100)]
man: s/io.systemd.Dropin/io.systemd.DropIn/
Frantisek Sumsal [Fri, 24 Mar 2023 14:19:21 +0000 (15:19 +0100)]
userdbctl: don't show legend when dumping JSON with services
Lennart Poettering [Fri, 24 Mar 2023 13:52:34 +0000 (14:52 +0100)]
man: update syscal filter group list
Franck Bui [Mon, 20 Mar 2023 17:23:33 +0000 (18:23 +0100)]
test: on openSUSE install the collection of unit test binaries in the target only for TEST-02-UNITTESTS
Franck Bui [Fri, 17 Mar 2023 13:18:50 +0000 (14:18 +0100)]
meson: make sure the unit test scripts find testdata/ even if they are not installed in the same directory
testdata/ is shared by both the unit tests and the integration tests. Hence it
makes sense to place them right under /usr/lib/systemd/tests/ while the tests
themself are located under dedicated sub-directories:
/usr/lib/systemd/tests/
├── integration-tests
├── testdata
└── unit-tests
├── testdata -> ../testdata
However the unit tests implemented as shell scripts (such as
test-fstab-generator.sh) expect to find testdata/ where the scripts are
installed, ie they do something like:
src="$(dirname "$0")/testdata/test-fstab-generator"
This patch installs a symlink in 'unitestsdir' named "testdata" and that points
to whatever value 'testdata_dir' is set.
Franck Bui [Fri, 17 Mar 2023 13:14:16 +0000 (14:14 +0100)]
meson: define testdata_dir globally
Franck Bui [Thu, 26 Jan 2023 15:07:17 +0000 (16:07 +0100)]
test: install unit tests in a dedicated subdirectory below '$testsdir'
/usr/lib/systemd/tests may contain more than the unit tests. For example on
SUSE we also install the integration tests there.
Putting the unit tests in a dedicated directory named 'unit-tests' makes the
layout cleaner.
Note that `run-unit-tests.py` has not been moved so we don't need to adjust
(Fedora) packaging and users also don't need to descend into the subdirectory.
Daan De Meyer [Fri, 24 Mar 2023 11:21:45 +0000 (12:21 +0100)]
chase-symlinks: Allow optional path with CHASE_EXTRACT_FILENAME
This allows helpers to set it unconditionally even if the caller
is not interested in the path.
Daan De Meyer [Tue, 21 Mar 2023 20:17:22 +0000 (21:17 +0100)]
chase-symlinks: Rename chase_symlinks() to chase()
Chasing symlinks is a core function that's used in a lot of places
so it deservers a less verbose names so let's rename it to chase()
and chaseat().
We also slightly change the pattern used for the chaseat() helpers
so we get chase_and_openat() and similar.
Zbigniew Jędrzejewski-Szmek [Fri, 24 Mar 2023 12:38:54 +0000 (13:38 +0100)]
Merge pull request #26785 from keszybz/udev-distcheck
Implement --help/--version in all udev builtins
Jan Janssen [Tue, 21 Mar 2023 16:10:19 +0000 (17:10 +0100)]
ukify: Add riscv32 and loongarch support
Jan Janssen [Tue, 21 Mar 2023 16:07:06 +0000 (17:07 +0100)]
ukify: Use pefile to add sections to EFI stub
Lennart Poettering [Fri, 24 Mar 2023 10:35:55 +0000 (11:35 +0100)]
analyze: don't claim "@known" was an unlisted syscall
It's a sycall group of our own definition, and the output is erroneous
to claim otherwise. Let's hide it.
This adds syscall_set_add() which is nicely symmetric to the existing
syscall_set_remove().
Follow-up for:
6d6a08547c03f96dc798cda1ef4a8d3013d292d5
Lennart Poettering [Fri, 24 Mar 2023 10:17:08 +0000 (11:17 +0100)]
seccomp-util: enforce group ordering
So far we asked via a comment that @default should stay the first group
and @known the last group in the list. Let's enforce that statically, in
code, too.
Lennart Poettering [Fri, 24 Mar 2023 10:16:38 +0000 (11:16 +0100)]
seccomp-util: add some newer syscalls to existing groups
These three new syscalls are mostly just new flavours or extensions of
existing syscalls, hence add them to the same groups.
Lennart Poettering [Fri, 24 Mar 2023 10:15:21 +0000 (11:15 +0100)]
seccomp-util: add new @sandbox syscall group with landlock/seccomp
Let's group these 4 syscalls, as they offer similar things and I guess
might be used in conjunction quite often, as they offer unprivileged
sandboxing.
Fixes: #26913
Frantisek Sumsal [Tue, 21 Mar 2023 22:19:41 +0000 (23:19 +0100)]
test: add a couple of tests for systemd-coredump
Daan De Meyer [Fri, 24 Mar 2023 10:33:58 +0000 (11:33 +0100)]
Merge pull request #26958 from yuwata/nulstr-optionally-drop-trailing-nulstr
nulstr: make strv_parse_nulstr() optionally drop trailing NULs
Daan De Meyer [Fri, 24 Mar 2023 10:29:54 +0000 (11:29 +0100)]
Merge pull request #26957 from yuwata/proc-cmdline-cleanups
proc-cmdline: several cleanups
Daan De Meyer [Fri, 24 Mar 2023 10:28:00 +0000 (11:28 +0100)]
Merge pull request #26948 from yuwata/vconsole-fix-memleak
vconsole: introduce Context and its helper functions
Daan De Meyer [Fri, 24 Mar 2023 10:27:45 +0000 (11:27 +0100)]
Merge pull request #26956 from yuwata/core-main-arguments-followed-by-equal
core/main: make arguments followed by '='
Yu Watanabe [Thu, 23 Mar 2023 02:59:44 +0000 (11:59 +0900)]
process-util: drop trailing NUls before parsing the nulstr
No functional changes, just refactoring.
Yu Watanabe [Thu, 23 Mar 2023 03:40:03 +0000 (12:40 +0900)]
test: add tests from strv_parse_nulstr_full()
Yu Watanabe [Thu, 23 Mar 2023 03:39:36 +0000 (12:39 +0900)]
nulstr-util: introduce strv_parse_nulstr_full() that optionally drop trailing empty strings
Yu Watanabe [Wed, 22 Mar 2023 20:52:32 +0000 (05:52 +0900)]
test-proc-cmdline: test proc_cmdline_get_key() actually parses EFI options
Follow-up for
53aa0d02add93d8c0afa2772609372a2040c162a.
Yu Watanabe [Wed, 22 Mar 2023 19:55:59 +0000 (04:55 +0900)]
proc-cmdline: make proc_cmdline_parse_given() static
It is used only in proc-cmdline.c and its test. And the test can be
covered by proc_cmdline_parse().
Yu Watanabe [Wed, 22 Mar 2023 18:06:16 +0000 (03:06 +0900)]
proc-cmdline: use proc_cmdline_key_string() when we search for key
Yu Watanabe [Wed, 22 Mar 2023 19:32:23 +0000 (04:32 +0900)]
proc-cmdline: rename variable
Yu Watanabe [Thu, 23 Mar 2023 00:21:28 +0000 (09:21 +0900)]
proc-cmdline: insert an empty line between variable declaration and assertion
Yu Watanabe [Thu, 23 Mar 2023 05:10:30 +0000 (14:10 +0900)]
core/main: make positional arguments followed by '=', then by value
To make ConditionKernelCommandLine= or friend not confused when we are
running in a container.
Addresses https://github.com/systemd/systemd/pull/26887#discussion_r1143358884.
Yu Watanabe [Mon, 20 Mar 2023 23:02:16 +0000 (08:02 +0900)]
core/main: fix maximum number of arguments for shutdown command
Follow-up for
c5673ed0de3bec38f68d8113d253842b47766e27.
Yu Watanabe [Fri, 24 Mar 2023 05:54:15 +0000 (14:54 +0900)]
vconsole: introduce context_get_config() helper function
And make keyboard_load_and_wait() and font_load_and_wait() take Context.
Yu Watanabe [Thu, 23 Mar 2023 13:30:30 +0000 (22:30 +0900)]
vconsole: introduce Context and its helper functions
Fixes memleaks introduced by
01771226c202183ff447da712f43d2fad8874484
and
ea575e176aac9fa8f430bb30a3e8abd8da767a10
Fixes #26945.
Daan De Meyer [Thu, 23 Mar 2023 19:05:16 +0000 (20:05 +0100)]
chase-symlinks: Use xopenat() instead of open_mkdir_at()
We don't rely on any of the extra functionality of open_mkdir_at()
so let's just use xopenat() directly.
Luca Boccassi [Thu, 23 Mar 2023 23:13:42 +0000 (23:13 +0000)]
Merge pull request #26935 from keszybz/test-parse_aux
Add test for auxv parsing
Luca Boccassi [Thu, 23 Mar 2023 23:08:21 +0000 (23:08 +0000)]
Merge pull request #26949 from DaanDeMeyer/xopenat-reopen
loop-util: Add loop_device_make_by_path_at()
Lennart Poettering [Thu, 23 Mar 2023 11:33:41 +0000 (12:33 +0100)]
fileio: add new helper fdopen_independent()
This is a combination of fdopen() and fd_reopen(). i.e. it first reopens
the fd, and then converts that into a FILE*.
We do this at various places already manually. let's move this into a
helper call of its own.
Lennart Poettering [Thu, 23 Mar 2023 20:21:45 +0000 (21:21 +0100)]
Merge pull request #26953 from poettering/encrypted-cred-mini-refactor
core: minor refactoring of allowlisting TPM devices when encrypted creds are loaded
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.
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.
Zbigniew Jędrzejewski-Szmek [Wed, 22 Mar 2023 13:06:31 +0000 (14:06 +0100)]
test-coredump-util: also test parse_auxv() with unaligned data
Zbigniew Jędrzejewski-Szmek [Wed, 22 Mar 2023 12:42:40 +0000 (13:42 +0100)]
test-coredump-util: add tests for parse_aux()
The test files are /proc//auxv files copies from various architecutres
signified by the file name suffix.
Those tests are fairly simple, but when we run them on n architectures, we do
~n² cross-arch tests.
Zbigniew Jędrzejewski-Szmek [Wed, 22 Mar 2023 08:53:16 +0000 (09:53 +0100)]
coredump: split out parse_auxv() to src/shared/
No functional change. (We already checked for ELFCLASS32 or ELFCLASS64 before,
so even though there's a new check for other architectures, the only caller
only passes ELFCLASS32 or ELFCLASS64.)
Daan De Meyer [Thu, 23 Mar 2023 13:42:35 +0000 (14:42 +0100)]
loop-util: Add loop_device_make_by_path_at()
On top of taking a directory file descriptor, we use xopenat() so
that the function can also be used to work on existing file
descriptors to image files including all the logic to use O_DIRECT
and fallback to O_RDONLY if needed.
Daan De Meyer [Thu, 23 Mar 2023 13:30:43 +0000 (14:30 +0100)]
fs-util: Allow xopenat() to reopen existing file descriptors
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
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.
наб [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)
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.
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()
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
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.
Mike Yuan [Wed, 22 Mar 2023 12:15:19 +0000 (20:15 +0800)]
edit-util: alloc correct amount of memory