Commit Graph

85209 Commits

Author SHA1 Message Date
Lennart Poettering
b26e6207cb dissect-image: make verity params for mountfsd_mount_image() optional 2025-11-24 17:41:06 +00:00
Chris Down
e45f2aede9 Revert "nspawn: Fix broken host links for container journals" (#39879)
Reverts systemd/systemd#39727
2025-11-25 01:13:43 +08:00
Daan De Meyer
8c22cb264d core: Make libmount optional (#39878) 2025-11-24 17:19:26 +01:00
Antonio Alvarez Feijoo
7599d26436 run: fix two minor memory leaks
```
==19541== 8 bytes in 1 blocks are still reachable in loss record 1 of 3
==19541==    at 0x4841744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19541==    by 0x50125C9: strdup (strdup.c:42)
==19541==    by 0x4C55925: getusername_malloc (user-util.c:154)
==19541==    by 0x1121D6: parse_argv_sudo_mode (run.c:1098)
==19541==    by 0x123B13: run (run.c:3032)
==19541==    by 0x124198: main (run.c:3100)
==19541==
==19541== 11 bytes in 1 blocks are still reachable in loss record 2 of 3
==19541==    at 0x4841744: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19541==    by 0x50125C9: strdup (strdup.c:42)
==19541==    by 0x112A9C: parse_argv_sudo_mode (run.c:1182)
==19541==    by 0x123B13: run (run.c:3032)
==19541==    by 0x124198: main (run.c:3100)
```
2025-11-24 16:03:34 +00:00
Lennart Poettering
77a1e2dec6 Revert "nspawn: Fix broken host links for container journals" 2025-11-24 16:34:00 +01:00
Daan De Meyer
5df44d0f6a core: Make libmount optional
Instead of skipping libcore entirely when libmount is not available,
let's only compile out the pieces that need libmount. This makes the
meson logic much less complex and allows systemd-analyze to be built
when libmount is not available.
2025-11-24 16:23:10 +01:00
Daan De Meyer
9c2cd09420 test: Skip protect_kernel_logs test if libmount is missing
libmount is required for setup_namespace() so skip the test if it
is not available.
2025-11-24 16:10:31 +01:00
Lennart Poettering
39c343daa6 nspawn: fix CI 2025-11-24 15:53:47 +01:00
Yu Watanabe
da22ccf48f openssl-util: introduce openssl_extract_public_key() helper function
This splits out common logic in keyutil and systemd-measure.

Note, previously d2i_PUBKEY_fp() was used, but now it is replaced with
d2i_PUBKEY(), as musl seems to not support reading from memstream.
2025-11-24 22:49:55 +09:00
Daan De Meyer
4f6ef13f43 run0: Stay in cwd if --empower is specified without a user
If we run "run0 --empower", the expectation is to stay in the
current working directory, not switch to ~.
2025-11-24 14:39:34 +01:00
Lennart Poettering
c746488537 block dlopen() once we transition into some foreign namespace (#39824)
Let's make sure we never accidentally end up loading code from a foreign
namespace.
2025-11-24 14:14:16 +01:00
Daan De Meyer
d60206c49a meson: Still build libshared even if libmount is disabled (#39871)
Currently, if the libmount feature is disabled, we don't build libshared
and as a result skip building every other executable as well. Among
other things, this makes our nodeps CI builds kind of pointless since
hardly any code will be compiled.

Let's improve on the situation by making libmount properly optional in
libshared. Then, we only skip building the executables that actually
need libmount.
2025-11-24 14:05:29 +01:00
Yu Watanabe
0cc96fc213 test: use log_tests_skipped_errno() at one more place
Follow-up for 12d2abe082.
2025-11-24 21:16:39 +09:00
Daan De Meyer
7336f2c748 meson: Still build libshared even if libmount is disabled
Currently, if the libmount feature is disabled, we don't build
libshared and as a result skip building every other executable as
well. Among other things, this makes our nodeps CI builds kind of
pointless since hardly any code will be compiled.

Let's improve on the situation by making libmount properly optional
in libshared. Then, we only skip building the executables that
actually need libmount.
2025-11-24 13:09:41 +01:00
Daan De Meyer
e910f9bc63 test-reread-partition-table: Don't keep open fds around
Avoids EBUSY from BLKRRPART when built without libblkid support.
2025-11-24 13:09:41 +01:00
Daan De Meyer
dee7dfea1d test-reread-partition-table: Only check for CAP_SYS_ADMIN
We might have CAP_SYS_ADMIN even without being root.
2025-11-24 13:09:41 +01:00
Daan De Meyer
43687c22ab tests: Assume we're running in a chroot if check fails
running_in_chroot() will fail when a test is executed as a non-root
user without CAP_DAC_READ_SEARCH as it won't be able to access
/proc/1/root.

Let's make things more robust by skipping tests if we can't detect
if we're in a chroot or not, since if we can't even detect if we're
in a chroot or not, chances are we're missing the required privileges
to execute the test anyway.
2025-11-24 13:09:41 +01:00
Yu Watanabe
f866ff3df8 tree-wide: replace tab with space, adjust missing or duplicated space 2025-11-24 12:45:06 +01:00
Yu Watanabe
332bce5bd7 oomd: move check if processes can be killed into oomd_cgroup_kill()
This also adds a debuuging log if the check failed.
Addresses https://github.com/systemd/systemd/pull/39773#discussion_r2549439336.

Follow-up for 38e9d40c80.
2025-11-24 12:40:13 +01:00
Luca Boccassi
5da6a8ee6e man,doc: add uapi spec numbers to all links to uapi specs (#39867) 2025-11-24 11:15:09 +00:00
Lennart Poettering
ed3fcaae11 crash-handler: also disable dlopen(), just in case 2025-11-24 11:56:47 +01:00
Lennart Poettering
a08f2ea02d process-util: also disable dlopen() in safe_fork() 2025-11-24 11:56:47 +01:00
Lennart Poettering
9252e26f4c core: load libcryptsetup before forking off child that might need it 2025-11-24 11:56:47 +01:00
Lennart Poettering
c64a486058 sysext: load libraries before forking off worker child 2025-11-24 11:56:47 +01:00
Lennart Poettering
09596e7d1a repart: load libraries before forking off child 2025-11-24 11:56:47 +01:00
Lennart Poettering
52594c3184 udev: load a bunch of libs before we fork off worker processes 2025-11-24 11:56:47 +01:00
Lennart Poettering
5b2f52814b dissect-image: load library before we fork off metadata extractor child process 2025-11-24 11:56:47 +01:00
Lennart Poettering
e683dce1f1 portabled: load a bunch of libs before we fork off a dissector child processes 2025-11-24 11:56:47 +01:00
Lennart Poettering
6069de1ed3 pid1: pull in libmount unconditionally 2025-11-24 11:56:47 +01:00
Lennart Poettering
efaf5a763d execute: load a bunch of libs before we disable dlopen() 2025-11-24 11:56:35 +01:00
Lennart Poettering
800d11c36c nspawn: load three libraries we'll need later before we fork() a child 2025-11-24 11:49:44 +01:00
Lennart Poettering
2c7bdaf9f1 dlfcn-util: let's make our dlopen() code fail if we enter a container namespace
Now that we dlopen() so many deps, it might happen by accident that we
end up dlopen()ening stuff when we entered a container, which we should
really avoid, to not mix host and container libraries.

Let's add a global variable we can set when we want to block dlopen() to
ever succeed. This is then checked primarily in
dlopen_many_sym_or_warn(), where we'll generate EPERM plus a log
message.

There are a couple of other places we invoke dlopen(), without going
through dlopen_many_sym_or_warn(). This adds the same check there.
2025-11-24 09:19:33 +01:00
Craig McLure
ab5a79ff5d hwdb: Add alternative mode for Beacn Mic (#39868)
The Beacn Mic's alt-mode behaves identically to it's primary mode from a
communication perspective, it just presents a different channel
configuration to ALSA.
2025-11-24 15:02:10 +09:00
Lennart Poettering
fc3adbbbcb man: always prefix links to uapi specs with their UAPI.XY spec number
Let's try to establish the spec numbers, by mentioning them in most doc
links.

Follow-up for: https://github.com/uapi-group/specifications/pull/187
2025-11-23 18:09:11 +01:00
Lennart Poettering
81b52a013c docs: reference UAPI specs by their number when linked 2025-11-23 17:16:09 +01:00
Yu Watanabe
19deb47ade firstboot: drop redundant and spurious errno check
Follow-up for 2319154a6b.
2025-11-23 22:36:50 +09:00
Luca Boccassi
941b91600c boot: ensure profile IDs do not get leaked and overwritten when there are tries suffixes
boot_entry_parse_tries() replaces the id, which means the id
with the profile appended is lost (leaked) and replaced by a plain filename
in case there are tries suffixes. This means the wrong order is used in
displaying the entries in the menu, as the main profile is always last
given id_without_profile has the tries suffixes and sorts higher,
while the main profile has no id_without_profile and the id sorts lower
since it does not have the tries suffix.

Follow-up for 4301ad00ef
2025-11-23 11:04:51 +09:00
Yu Watanabe
2d82ebf600 core/selinux-setup: actually skip setup gracefully when libselinux is not available (#39859) 2025-11-23 09:11:32 +09:00
Daan De Meyer
dd281e19a7 docs: Document cast formatting rules 2025-11-22 23:41:46 +01:00
Mike Yuan
375a4bd878 core/selinux-setup: actually skip setup gracefully when libselinux is not available
Follow-up for 83b6ef9b62
2025-11-22 19:07:28 +01:00
Mike Yuan
32b7a07b8c core/exec-invoke: deduplicate needs_setuid with needs_sandboxing 2025-11-22 19:07:28 +01:00
Yu Watanabe
f53ac7742f clang-tidy: Enable misc-include-cleaner check (#39835)
The previous commit fixes all remaining violations of the check for
a very specific setup (Fedora Rawhide with as many dependencies as
possible installed). The linter job in CI runs that specific setup
so we enable the check in the clang-tidy config but do not yet enable
the clang-tidy test suite in meson by default as it will very likely
still fail in different setups than the one in CI.
2025-11-22 20:54:28 +09:00
Daan De Meyer
6d57f584de clang-tidy: Enable misc-include-cleaner check
The previous commit fixes all remaining violations of the check for
a very specific setup (Fedora Rawhide with as many dependencies as
possible installed). The linter job in CI runs that specific setup
so we enable the check in the clang-tidy config but do not yet enable
the clang-tidy test suite in meson by default as it will very likely
still fail in different setups than the one in CI.
2025-11-22 10:19:41 +01:00
Daan De Meyer
87fbd33372 clang-tidy: Fix all remaining misc-include-cleaner violations
- Remove unused includes
- Add common false positive headers to misc-include-cleaner.IgnoreHeaders
- Add IWYU pragma keep for uncommon false positive headers
2025-11-22 10:19:41 +01:00
Daan De Meyer
d11ce97386 test-journald-config: Modernize test 2025-11-22 10:19:07 +01:00
Zbigniew Jędrzejewski-Szmek
add1828861 Various logging fixlets (#39837) 2025-11-22 10:14:10 +01:00
Yu Watanabe
229e106a6e NEWS: drop one sentence
We have agreed the bump.
2025-11-22 10:43:17 +09:00
Yu Watanabe
e6baa5ba0b Use SD_JSON_BUILD_PAIR_* macros if possible in shared/core/home (#39845) 2025-11-22 10:04:02 +09:00
Yu Watanabe
924081f793 pam-systemd-home: various logging cleanups 2025-11-22 09:42:41 +09:00
Yu Watanabe
447eb0a00c pam-systemd-loadkey: append full stop 2025-11-22 09:42:41 +09:00