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")
Yu Watanabe [Sun, 19 Mar 2023 07:39:15 +0000 (16:39 +0900)]
loop-util: add more debugging logs in loop_configure()
taniishkaaa [Sun, 19 Mar 2023 05:16:00 +0000 (10:46 +0530)]
hwdb: fix Wifi toggling for Haier 7G-Series/JWU (#25293) (#26878)
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
Yu Watanabe [Sat, 18 Mar 2023 17:49:11 +0000 (02:49 +0900)]
Merge pull request #26880 from yuwata/test-tmpfiles
tmpfiles: cleanups
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
Mike Yuan [Sat, 18 Mar 2023 17:32:50 +0000 (01:32 +0800)]
docs: 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
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.
Yu Watanabe [Sat, 18 Mar 2023 13:20:49 +0000 (22:20 +0900)]
test-systemd-tmpfiles.py: use test_content() at one more place
Yu Watanabe [Sat, 18 Mar 2023 13:00:34 +0000 (22:00 +0900)]
tmpfiles: show file type in octal, instead of hex
Frantisek Sumsal [Sat, 18 Mar 2023 12:58:27 +0000 (13:58 +0100)]
tree-wide: simplify x ? x : y to x ?: y where applicable
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
Frantisek Sumsal [Sat, 18 Mar 2023 12:52:28 +0000 (13:52 +0100)]
coccinelle: respect spacing from the semantic patch
Yu Watanabe [Sat, 18 Mar 2023 06:51:37 +0000 (15:51 +0900)]
man: explicitly list three command syntax at the beginning
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
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.
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
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
Yu Watanabe [Sat, 18 Mar 2023 06:03:38 +0000 (15:03 +0900)]
Merge pull request #26855 from DaanDeMeyer/repart-fixes
Repart fixes
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
Mike Yuan [Fri, 17 Mar 2023 07:13:56 +0000 (15:13 +0800)]
sleep: fix default values unmatched with manual
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
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
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.
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
Yu Watanabe [Fri, 17 Mar 2023 05:20:29 +0000 (14:20 +0900)]
uki-util: move functions for inspecting kernel to uki-util.[ch]
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.
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.
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.
Yu Watanabe [Fri, 17 Mar 2023 05:26:14 +0000 (14:26 +0900)]
bootctl: return 0 instead of EXIT_SUCCESS
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.
Yu Watanabe [Wed, 15 Mar 2023 22:51:09 +0000 (07:51 +0900)]
os-util: add missing headers
For 'bool' and 'usec_t'.
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.
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.
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.
Yu Watanabe [Fri, 17 Mar 2023 03:56:05 +0000 (12:56 +0900)]
exec-util: drop meaningless casts
Yu Watanabe [Fri, 17 Mar 2023 03:46:51 +0000 (12:46 +0900)]
exec-util: tighten variable scope a bit
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
Jan Janssen [Sun, 12 Mar 2023 15:51:48 +0000 (16:51 +0100)]
boot: Add undefined sanitizer support
Sadly, no stack traces, but this is better than nothing.
Jan Janssen [Fri, 10 Mar 2023 08:57:50 +0000 (09:57 +0100)]
meson: Share more C flags
Jan Janssen [Fri, 10 Mar 2023 08:21:08 +0000 (09:21 +0100)]
boot: Add support for -ftrapv
Jan Janssen [Fri, 10 Mar 2023 08:01:29 +0000 (09:01 +0100)]
boot: Add support for -fstack-protector
Jan Janssen [Fri, 10 Mar 2023 08:12:05 +0000 (09:12 +0100)]
boot: Detect nested assertions
Daan De Meyer [Fri, 17 Mar 2023 09:00:43 +0000 (10:00 +0100)]
Merge pull request #26783 from yuwata/loop-ref-follow-up
udev: slightly extend comment and add more tests
Yu Watanabe [Wed, 15 Mar 2023 19:50:08 +0000 (04:50 +0900)]
test: add a testcase that dir_fd_is_root() is not confused by bind mount
See the comment in dir_fd_is_root() and
https://github.com/systemd/systemd/pull/26820#issuecomment-
1469554966.
Yu Watanabe [Fri, 17 Mar 2023 03:14:04 +0000 (12:14 +0900)]
Merge pull request #26803 from yuwata/udevadm-verify-summary
udevadm-verify: print a short summary
Daan De Meyer [Thu, 16 Mar 2023 17:28:14 +0000 (18:28 +0100)]
mkosi: Enable some debugging options by default
Addison Snelling [Fri, 17 Mar 2023 02:36:32 +0000 (21:36 -0500)]
man: fix misspelled executable name (#26858)
Daan De Meyer [Thu, 16 Mar 2023 22:15:19 +0000 (23:15 +0100)]
repart: Report better errors if partition sizes are too small
Daan De Meyer [Thu, 16 Mar 2023 21:11:31 +0000 (22:11 +0100)]
repart: Zero full verity signature partition size
systemd-dissect requires the entirety of the partition following the
signature to be zeroed, so let's do just that.
Daan De Meyer [Thu, 16 Mar 2023 21:10:50 +0000 (22:10 +0100)]
repart: Make sure we seek to beginning of partition target before copy
Daan De Meyer [Thu, 16 Mar 2023 11:12:38 +0000 (12:12 +0100)]
mkosi: Use default timeout of 10s
Let's override the default timeout to something more reasonable for
mkosi builds.
Frantisek Sumsal [Thu, 16 Mar 2023 10:42:12 +0000 (11:42 +0100)]
test: wrap mkfs.*/mksquashfs/mkswap binaries when running w/ ASan
Daan De Meyer [Thu, 16 Mar 2023 10:22:58 +0000 (11:22 +0100)]
journald-console: Add colors when forwarding to console
Let's color output when we're forwarding to the console. To make this
work, we inherit TERM from pid 1 and use it to decide whether we should
output colors or not.
Daan De Meyer [Thu, 16 Mar 2023 10:21:28 +0000 (11:21 +0100)]
terminal-util: Don't assume terminal is dumb if connected to /dev/null
If we're connected to /dev/null, we're likely going to be writing
colors to something that's not stdout/stderr, so let's fall back to
checking TERM if that's the case.
Luca Boccassi [Thu, 16 Mar 2023 00:17:50 +0000 (00:17 +0000)]
doc: update ELF_PACKAGE_METADATA to use linker flag instead of manual script
bfd/gold/mold/lld support this flag, so document it explicitly, and drop the
manually written linker script which is no longer necessary
Yu Watanabe [Wed, 15 Mar 2023 20:25:39 +0000 (05:25 +0900)]
test: add tests for summary output of udevadm verify
Yu Watanabe [Wed, 15 Mar 2023 20:04:35 +0000 (05:04 +0900)]
test: reindent testsuite-17.11.sh
Yu Watanabe [Mon, 13 Mar 2023 12:32:30 +0000 (21:32 +0900)]
udevadm-verify: add a short summary
Yu Watanabe [Wed, 15 Mar 2023 06:12:41 +0000 (15:12 +0900)]
sd-journal: fix segfault
Unfortunately, journal_file_next_entry() returns 0 when the next entry
not found. The commit
cc938e4a0ab67707e489cc3970a8557ad89801ca adds
FIXME comment about that. We should really fix that, but the function and
its return value are used in many place, hence checking all usecases is not
easy. So, let's workaround that here, and handle the 0 return value by
the caller.
Follow-up for
34af74946e8853411f18120007ebaca6549b2a52.
Fixes #26822.
Luca Boccassi [Thu, 16 Mar 2023 00:25:01 +0000 (00:25 +0000)]
Merge pull request #26835 from poettering/userdb-modernizations
various userdbd modernizations
OMOJOLA JOSHUA [Wed, 15 Mar 2023 22:52:24 +0000 (23:52 +0100)]
updated usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WIT… (#26840)
* localed: update usage of SD_BUS_METHOD_WITH_NAMES macros to SD_BUS_METHOD_WITH_ARGS
Yu Watanabe [Wed, 15 Mar 2023 19:12:52 +0000 (04:12 +0900)]
github: update default and example in template
Yu Watanabe [Wed, 15 Mar 2023 19:02:11 +0000 (04:02 +0900)]
Merge pull request #26771 from YHNdnzj/machinectl-edit
machinectl: add verb edit and cat to operate on .nspawn files
Ludwig Nussel [Wed, 15 Mar 2023 09:20:59 +0000 (10:20 +0100)]
manager: fix scope for environment generators
fixes regression introduced by
4870133bfa
Dmitry V. Levin [Wed, 15 Mar 2023 08:00:00 +0000 (08:00 +0000)]
test: fix testsuite-17.10.sh
Make sure /etc/udev/hwdb.d/ exists before creating a file inside it.
Fixes:
95cf8cae77f7 ("test: add coverage test for udevadm")
Yu Watanabe [Wed, 15 Mar 2023 18:51:55 +0000 (03:51 +0900)]
Merge pull request #26831 from YHNdnzj/edit-util-followup
edit-util: follow-ups
Dmitry V. Levin [Sun, 12 Mar 2023 08:00:00 +0000 (08:00 +0000)]
udev-rules: check for conflicting and duplicate expressions
Log an error when a rule line contains conflicting match expressions, e.g.
NAME=="value", NAME!="value"
Log a warning when a rule line contains duplicate expressions, e.g.
NAME=="value", NAME=="value"
Cornelius Hoffmann [Wed, 15 Mar 2023 15:28:00 +0000 (16:28 +0100)]
Update github issue template to include systemd-dissect
Lennart Poettering [Wed, 15 Mar 2023 14:48:17 +0000 (15:48 +0100)]
userdbd: make static const what we can make so
Lennart Poettering [Wed, 15 Mar 2023 14:46:54 +0000 (15:46 +0100)]
userdbd: rework to use sd_event_add_child() instead of manual SIGCHLD
Let's modernize userdbd furzer, and use the common child handling we
nowadays have in sd-event, instead of rolling our own.
This also means we'll start using pidfds where we can.
Lennart Poettering [Wed, 15 Mar 2023 14:01:11 +0000 (15:01 +0100)]
userdbd: make use of FORK_CLOSE_ALL_FDS + FORK_REOPEN_LOG where we can
Lennart Poettering [Wed, 15 Mar 2023 13:59:32 +0000 (14:59 +0100)]
userdbd: modernize signal handling
Let's make use of SD_EVENT_SIGNAL_PROCMASK so that we don't have to mask
the signals manually. Let's use sd_event_set_exit_signal() instead of
rolling our own SIGTERM/SIGINT handling. Let's use "floating" event
sources instead of keeping references on our own.
Let's also debug log if we can't enable watchdog handling.
Daan De Meyer [Wed, 15 Mar 2023 14:51:47 +0000 (15:51 +0100)]
Merge pull request #26784 from DaanDeMeyer/chase-fix
Allow creating files and directories with chase_symlinks_open() and further improvements
Daan De Meyer [Wed, 15 Mar 2023 10:55:44 +0000 (11:55 +0100)]
fs-util: Drop unlink_noerrno()
Mike Yuan [Mon, 13 Mar 2023 12:33:36 +0000 (20:33 +0800)]
test: add testsuite-74.machinectl
Mike Yuan [Sat, 11 Mar 2023 16:56:13 +0000 (00:56 +0800)]
machinectl: add verb edit and cat to operate on .nspawn files
This allows operating on .nspawn files using machinectl.
Closes #26246
Mike Yuan [Wed, 15 Mar 2023 11:38:19 +0000 (19:38 +0800)]
edit-util: log unexpected errors if we fail to remove the parent dir
Daan De Meyer [Wed, 15 Mar 2023 11:48:14 +0000 (12:48 +0100)]
Merge pull request #26820 from DaanDeMeyer/dir-fd-is-root
fd-util: Add dir_fd_is_root()
Mike Yuan [Mon, 13 Mar 2023 02:16:14 +0000 (10:16 +0800)]
edit-util: use path_equal
Daan De Meyer [Tue, 14 Mar 2023 12:52:50 +0000 (13:52 +0100)]
chase-symlinks: Add more assertions
Let's turn some runtime errors into assertions and add a few new
assertions.
Daan De Meyer [Mon, 13 Mar 2023 15:17:21 +0000 (16:17 +0100)]
chase-symlinks: Rework open() functions and some chase flags
Currently, when CHASE_PARENT is specified, we chase the parent directory
of the symlink itself. Let's change this and chase the parent directory
of the symlink target so that trying to open the actual file later with
O_NOFOLLOW doesn't fail with ELOOP.
To get the current behavior, callers can add CHASE_NOFOLLOW to chase
the parent directory of the symlink itself.
Currently, when CHASE_MKDIR_0755 is specified, we create all components
of the path as directories. Instead, let's change the flag to only create
parent directories and leave the final component of the PATH untouched.
Also, allow CHASE_NONEXISTENT with CHASE_MKDIR_0755 now that it doesn't
create all components anymore.
Finally, rework chase_symlinks_and_open() and chase_symlinkat_at_and_open()
to always chase the parent directory and use xopenat() to open the final
component of the path. This allows us to pass O_CREAT to create the file or
directory (O_DIRECTORY) if it is missing. If CHASE_PARENT is configured, we
just reopen the parent directory that we chased.
bri [Sat, 11 Mar 2023 22:38:35 +0000 (17:38 -0500)]
Add rebrands of Medion Akoya notebooks/tablets
Luca Boccassi [Wed, 15 Mar 2023 10:56:07 +0000 (10:56 +0000)]
Merge pull request #26804 from fbuihuu/fixes-for-test-58-repart
Fixes for test 58 repart
Daan De Meyer [Wed, 1 Feb 2023 12:14:29 +0000 (13:14 +0100)]
fd-util: Add dir_fd_is_root()
Daan De Meyer [Tue, 14 Mar 2023 21:00:11 +0000 (22:00 +0100)]
mountpoint-util: Add path_get_mnt_id_at()
Luca Boccassi [Wed, 15 Mar 2023 10:49:35 +0000 (10:49 +0000)]
Merge pull request #26825 from keszybz/log-message-fix
Log message fix
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 21:56:42 +0000 (22:56 +0100)]
core: fix "(null)" in output
We want an empty string, not NULL. I made some brainfart here.
Fixup for
1980a25dc03aa500d4ee2725d696f68d265cd4ca.
Zbigniew Jędrzejewski-Szmek [Tue, 14 Mar 2023 15:52:18 +0000 (16:52 +0100)]
core: reduce scope of variable
Lennart Poettering [Wed, 15 Mar 2023 08:28:09 +0000 (09:28 +0100)]
Merge pull request #26800 from t-8ch/memfd_create
memfd: add support for exec flags
Lennart Poettering [Wed, 15 Mar 2023 08:27:47 +0000 (09:27 +0100)]
Merge pull request #26794 from bluca/log_extra_fields
core: append LogExtraFields= values to log_unit* messages
Luca Boccassi [Tue, 14 Mar 2023 20:12:33 +0000 (20:12 +0000)]
core: make the memory pressure cgroup path writable when ProtectControlGroups=yes
The interface requires services to write to the cgroup file to activate notifications,
but with ProtectControlGroups=yes we make it read-only. Add a writable bind mount.
Follow-up for
6bb0084204bd93122c9f04391b80aea5a8a0ff08
Franck Bui [Thu, 26 Jan 2023 15:14:01 +0000 (16:14 +0100)]
test: assume run-unit-tests.py and unit tests are installed in the same directory
This avoids hard coding the path of the directory where the unit tests are
installed.
Thomas Weißschuh [Tue, 14 Mar 2023 03:42:23 +0000 (03:42 +0000)]
treewide: memfd_create: use exec flags
Use the flags MEMFD_EXEC or MEMFD_NOEXEC_SEAL as applicable.
These warnings instruct the kernel wether the memfd is executable or
not.
Without specifying those flags the kernel will emit the following
warning since version 6.3,
commit
105ff5339f49 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC"):
kernel: memfd_create() without MFD_EXEC nor MFD_NOEXEC_SEAL, pid=1 'systemd'
Thomas Weißschuh [Tue, 14 Mar 2023 03:42:05 +0000 (03:42 +0000)]
memfd-util: add wrapper for memfd_create
The wrapper removes the flags MFD_EXEC and MFD_NOEXEC_SEAL when running
on kernels not understanding those flags.
Thomas Weißschuh [Mon, 13 Mar 2023 14:14:21 +0000 (14:14 +0000)]
missing: add memfd exec flags
Jan Janssen [Tue, 14 Mar 2023 13:32:43 +0000 (14:32 +0100)]
stub: Remove overlapping PE section warning
Now that we always create PE images with a non-zero image base we cannot
run into this issue anymore. Any tool that still uses the old hard-coded
section offsets will end up creating bad images with sections below the
image base. objcopy will warn about this and any PE loader will simply
refuse to load such an image. Meanwhile updated tools do not use
hard-coded offsets anymore.
Luca Boccassi [Wed, 15 Mar 2023 00:24:02 +0000 (00:24 +0000)]
Merge pull request #26815 from keszybz/cgls-no-xattrs-by-default
Do not show xattrs and cgroup ids in cgls by default
Luca Boccassi [Wed, 15 Mar 2023 00:23:05 +0000 (00:23 +0000)]
Merge pull request #26808 from keszybz/no-controllers-followup
Docs and dump output follow-up for the case of delegation with no controllers