]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 days agolibmount-util: build .c only if libmount feature is enabled 39884/head
Mike Yuan [Tue, 25 Nov 2025 02:26:10 +0000 (03:26 +0100)] 
libmount-util: build .c only if libmount feature is enabled

Follow-up for 7336f2c748fd37a60a3f5353ad198c1534d6cb5f

This alignes with some other optional modules in shraed/,
and it allows dlopen_libmount() to be optimized out entirely.
Let's avoid emitting pointless symbols.

5 days agoRevert "pid1: pull in libmount unconditionally"
Mike Yuan [Tue, 25 Nov 2025 02:19:37 +0000 (03:19 +0100)] 
Revert "pid1: pull in libmount unconditionally"

This reverts commit 6069de1ed34735482dc63ba7431f605b858ea719.

5 days agocore/mount: comprehensively disable mount unit support if no libmount
Mike Yuan [Tue, 25 Nov 2025 01:34:08 +0000 (02:34 +0100)] 
core/mount: comprehensively disable mount unit support if no libmount

Follow-up for b3243f4beead231e27a4f017f53288a303177cb2
and 5df44d0f6a1ba23b52b0c46a5e720f334f152ae5

Since we now consider this a supported senario, let's hook up
libmount loading with the high-level unit_type_supported() machinery
and gracefully skip the whole unit accordingly.

5 days agodlfcn-util: fix potential dl handle leak
Mike Yuan [Tue, 25 Nov 2025 02:52:57 +0000 (03:52 +0100)] 
dlfcn-util: fix potential dl handle leak

Follow-up for 2c7bdaf9f144ad339c72628579183fc849f2b794

5 days agorun: Don't make executable absolute when --root-directory= is used
Daan De Meyer [Mon, 24 Nov 2025 18:52:40 +0000 (19:52 +0100)] 
run: Don't make executable absolute when --root-directory= is used

Also, unless --same-root-dir was specified, don't make the executable
absolute if we're running in a chroot. Situations like this are still iffy,
but we might as well handle them a little more gracefully.

5 days agosd-journal: fix a copy-paste error
Frantisek Sumsal [Tue, 25 Nov 2025 17:40:10 +0000 (18:40 +0100)] 
sd-journal: fix a copy-paste error

Dereference the Directory pointer in the debug message instead of the
(probably already freed) JournalFile one.

5 days agotree-wide: Fix constness issues with newer glibc (#39896)
Zbigniew Jędrzejewski-Szmek [Tue, 25 Nov 2025 23:32:54 +0000 (00:32 +0100)] 
tree-wide: Fix constness issues with newer glibc (#39896)

Latest glibc uses _Generic to have strstr() and other functions return
const char* or char* based on whether the input is a const char* or a
char*. This causes build failures as we previously always expected a
char*.

Let's fix the compilation failures and add our own macros similar to
glibc's to have string functions that return a mutable or const pointer
depending on the input.

6 days agotree-wide: Fix constness issues with newer glibc 39896/head
Daan De Meyer [Tue, 25 Nov 2025 15:46:04 +0000 (16:46 +0100)] 
tree-wide: Fix constness issues with newer glibc

Latest glibc uses _Generic to have strstr() and other functions return
const char* or char* based on whether the input is a const char* or a
char*. This causes build failures as we previously always expected a char*.

Let's fix the compilation failures and add our own macros similar to glibc's
to have string functions that return a mutable or const pointer depending on
the input.

6 days agotree-wide: sizeof() fixes
Daan De Meyer [Fri, 21 Nov 2025 08:25:18 +0000 (09:25 +0100)] 
tree-wide: sizeof() fixes

- TIME_T_MAX is always time_t so the check in time-util.c was redundant
- quota-util.c was zero-ing a pointer
- smbios11.c was calling sizeof(pointer)

6 days agorun0: Give --empower its own color, title and emoji
Daan De Meyer [Mon, 24 Nov 2025 18:48:49 +0000 (19:48 +0100)] 
run0: Give --empower its own color, title and emoji

When in --empower mode, all created files will be owned by the current
user, which could be problematic when creating files outside of the
current user's home directory, as other processes running as the same
user would be able to edit those files.

While this is a bit of an edge case since users already have to go through
the effort of writing --empower to indicate they want a privileged session
as the current user, it's not unphatomable to think they could start an
empowered session which they later return to and continue using. Currently,
it's not easy to differentiate a regular run0 session and an empowered session
at a glance, so users might think they're using a regular run0 session when
they're actually using an empowered session.

To address this problem, let's give empowered session their own identify, by
making the background orange, using the pumpkin emoji as the shell prompt
prefix and giving them an orange circle as the PTY title.

6 days agoboot: Fix warning
Daan De Meyer [Tue, 25 Nov 2025 15:50:23 +0000 (16:50 +0100)] 
boot: Fix warning

memchr() is a macro on newer glibc so make sure to undefine it before
redefining it.

6 days agoopenssl-util: indentation fix
Yu Watanabe [Tue, 25 Nov 2025 13:16:16 +0000 (22:16 +0900)] 
openssl-util: indentation fix

Follow-up for 1144f07dc69cc04138d90000b1782c4a2b27cd94.

6 days agoTEST-02-UNITTESTS: drop outdated comment
Yu Watanabe [Tue, 25 Nov 2025 06:22:58 +0000 (15:22 +0900)] 
TEST-02-UNITTESTS: drop outdated comment

Follow-up for 741d59b326ea25053097fcbf004864ea6b3c6299.

6 days agodocs/MOUNT_REQUIREMENTS: fix typo
Yu Watanabe [Tue, 25 Nov 2025 13:51:25 +0000 (22:51 +0900)] 
docs/MOUNT_REQUIREMENTS: fix typo

Follow-ups for 3e94ae6f1e2bac0c6be2817ab419123ea37d8e4a.

6 days agoprocess-util: fix typo
Yu Watanabe [Tue, 25 Nov 2025 13:49:44 +0000 (22:49 +0900)] 
process-util: fix typo

Follow-up for a08f2ea02dc4fcbd7f2f73a5a24e0af32b34fe55.

6 days agomkosi: Add hyperscale profile (#39329)
Daan De Meyer [Tue, 25 Nov 2025 12:50:45 +0000 (13:50 +0100)] 
mkosi: Add hyperscale profile (#39329)

In the CentOS Hyperscale SIG, we maintain a backport of systemd with
its own rpm spec forked from rawhide.

Let's make it easy to build upstream rpms using the Hyperscale spec
by adding a mkosi hyperscale profile.

6 days agoTEST-88-UPGRADE: Stop resolved hook socket before downgrading
Daan De Meyer [Tue, 25 Nov 2025 09:41:24 +0000 (10:41 +0100)] 
TEST-88-UPGRADE: Stop resolved hook socket before downgrading

Otherwise it'll remain active and cause networkd to get started again
during the downgrade.

6 days agoAdjust code to query terminal size and other attributes (#39832)
Zbigniew Jędrzejewski-Szmek [Tue, 25 Nov 2025 10:43:26 +0000 (11:43 +0100)] 
Adjust code to query terminal size and other attributes (#39832)

6 days agomkosi: Add fixed qemu ppa for Noble temporarily 39329/head
Daan De Meyer [Wed, 19 Nov 2025 15:43:54 +0000 (16:43 +0100)] 
mkosi: Add fixed qemu ppa for Noble temporarily

Until https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/2127974
is fixed and rolled out, let's use enr0n's ppa with the fixed qemu
to make CI pass.

6 days agomkosi: Add hyperscale profile
Daan De Meyer [Mon, 1 Sep 2025 15:31:29 +0000 (17:31 +0200)] 
mkosi: Add hyperscale profile

In the CentOS Hyperscale SIG, we maintain a backport of systemd with
its own rpm spec forked from rawhide.

Let's make it easy to build upstream rpms using the Hyperscale spec
by adding a mkosi hyperscale profile.

6 days agomkosi: Rework how the pkgenv environment variables are set
Daan De Meyer [Mon, 1 Sep 2025 15:29:54 +0000 (17:29 +0200)] 
mkosi: Rework how the pkgenv environment variables are set

Instead of including distribution specific files in the subimages,
let's have one common mkosi.pkgenv/ directory that handles all the
matching which is then included in the subimages.

This gives us more control on exactly how we do the matching.

6 days agomkosi: update mkosi commit reference to 10544812b35a668d4aac9834c78ee8166e99bc78
Daan De Meyer [Wed, 15 Oct 2025 19:40:11 +0000 (21:40 +0200)] 
mkosi: update mkosi commit reference to 10544812b35a668d4aac9834c78ee8166e99bc78

10544812b3 Don't fix up vmlinuz locations if not required
9baf551923 Reduce amount of packages in default image
9e1a2f18b8 Add support for assert sections
c7c6e2c0b1 ubuntu: Switch to devel as the default release
0822deb69c Improve logging when we can not extract kernel version from filename
1fd7ef3db7 Do not build default initrd if Initrds= is specified
611c8b46c8 Don't unconditionally sync when PackageCacheDirectory=/var
ab37f24d38 README: add link to OBS docs for mkosi builds
02bf256ebb completion: add reuse ignore comments
10ccb0b04f Make sure not all subimages depend on default-initrd subimage
442e1ce0f1 mkosi-tools: systemd-boot-tools is now available for all arches
307fc1dba3 action: make it work when used as a submodule
c37a55f91b config: serialize dataclass instances in our JSONEncoder
f26cb34155 log: set terminal window title in complete_step while mkosi runs
280c78e681 Make sure inherited settings are applied for the default initrd
ae4f2fd718 Fix typo
5644f3e83e build(deps): bump github/codeql-action from 3.29.7 to 3.30.5
7d7b26b8c9 build(deps): bump actions/checkout from 4.2.2 to 5.0.0
e805253447 postmarketos: implement is_kernel_package
dd51d2e019 postmarketos: provide missing i386-vars.fd
e23e6de66b Do not relabel files when building extension image
ab05ead5eb Bump various systemd version checks to 258
382cc8b450 preset: drop systemd-networkd-wait-online.service
477b6b2ed5 mkosi-initrd: install systemd-container in network profile
1d167c0b53 mkosi-initrd: add 89-ethernet.network for network profile
b1e81dec3a mkosi-initrd: Install libseccomp explicitly
3c431a141c opensuse: repository non-oss-debug is invalid
62ab363149 ci: add an s390x build job for additional coverage
62765f2d07 mailmap: deduplicate Daan
47f963f40b Revert "ci: Disable PPC jobs temporarily"
6a48f83dda dnf: Always specify --best again
3702368616 sandbox: Make all relative paths absolute during argparsing
a587af0bf7 dnf: Fix /var package cache directory check in package_subdirs()
56cdbc25b5 Always use repository metadata from /var package cache directory
669d4418a3 Add note on Encrypt=yes to Passphrase= docs
caa129edae Drop BuildSourcesEphemeral=yes from default image config
7edca63478 Add devicetree-auto support for UKI
6cb1649074 Don't add ncdu for ppc64-le on Fedora
e019d2d2a6 ci: Disable PPC jobs temporarily

6 days agofactory: do not install nsswitch.conf when nss is disabled
Yu Watanabe [Sun, 23 Nov 2025 02:51:01 +0000 (11:51 +0900)] 
factory: do not install nsswitch.conf when nss is disabled

When systemd is built with musl, nss modules are not supported,
hence the file is not necessary. Let's not install the file.

6 days agobasic/terminal-util: ignore failures in cleanup 39832/head
Zbigniew Jędrzejewski-Szmek [Thu, 20 Nov 2025 15:37:30 +0000 (16:37 +0100)] 
basic/terminal-util: ignore failures in cleanup

Some of the functions were ignoring failure in cleanup, others weren't. If we
got a reply, it's better to use it, so ignore failures in cleanup everywhere.

6 days agobasic/terminal-util: operate on one fd in get_default_background_color()
Zbigniew Jędrzejewski-Szmek [Thu, 20 Nov 2025 13:33:26 +0000 (14:33 +0100)] 
basic/terminal-util: operate on one fd in get_default_background_color()

This moves the open call earlier, so that we do any state-changing operations
if we actually managed to open the nonblocking fd. The code is easier to follow
this way and might be more robust.

Suprisingly, this fixes https://github.com/systemd/systemd/issues/39055: it
seems that run0 chowns /dev/stdin (in my case /dev/pts/0) to root:root, and the
second run0 can read and write stdin/stdout throught the already-open fds,
but fd_reopen fails.

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

7 days agodiscover-image: use _SD_PATH_INVALID where appropriate
Lennart Poettering [Tue, 18 Nov 2025 21:32:41 +0000 (22:32 +0100)] 
discover-image: use _SD_PATH_INVALID where appropriate

The enum definition only exists for cases like this, use it, instead of
its literal value.

This doesn't effectively change anything, but cleans up the code a bit.

7 days agodissect-image: make verity params for mountfsd_mount_image() optional
Lennart Poettering [Wed, 19 Nov 2025 16:26:15 +0000 (17:26 +0100)] 
dissect-image: make verity params for mountfsd_mount_image() optional

7 days agoRevert "nspawn: Fix broken host links for container journals" (#39879)
Chris Down [Mon, 24 Nov 2025 17:13:43 +0000 (01:13 +0800)] 
Revert "nspawn: Fix broken host links for container journals" (#39879)

Reverts systemd/systemd#39727

7 days agocore: Make libmount optional (#39878)
Daan De Meyer [Mon, 24 Nov 2025 16:19:26 +0000 (17:19 +0100)] 
core: Make libmount optional (#39878)

7 days agorun: fix two minor memory leaks
Antonio Alvarez Feijoo [Mon, 24 Nov 2025 12:11:01 +0000 (13:11 +0100)] 
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)
```

7 days agoRevert "nspawn: Fix broken host links for container journals" 39879/head
Lennart Poettering [Mon, 24 Nov 2025 15:34:00 +0000 (16:34 +0100)] 
Revert "nspawn: Fix broken host links for container journals"

7 days agocore: Make libmount optional 39878/head
Daan De Meyer [Mon, 24 Nov 2025 14:33:26 +0000 (15:33 +0100)] 
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.

7 days agotest: Skip protect_kernel_logs test if libmount is missing
Daan De Meyer [Mon, 24 Nov 2025 15:08:57 +0000 (16:08 +0100)] 
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.

7 days agonspawn: fix CI
Lennart Poettering [Mon, 24 Nov 2025 14:30:23 +0000 (15:30 +0100)] 
nspawn: fix CI

7 days agoopenssl-util: introduce openssl_extract_public_key() helper function
Yu Watanabe [Mon, 24 Nov 2025 01:30:07 +0000 (10:30 +0900)] 
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.

7 days agorun0: Stay in cwd if --empower is specified without a user
Daan De Meyer [Mon, 24 Nov 2025 11:36:42 +0000 (12:36 +0100)] 
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 ~.

7 days agoblock dlopen() once we transition into some foreign namespace (#39824)
Lennart Poettering [Mon, 24 Nov 2025 13:14:16 +0000 (14:14 +0100)] 
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.

7 days agomeson: Still build libshared even if libmount is disabled (#39871)
Daan De Meyer [Mon, 24 Nov 2025 13:05:29 +0000 (14:05 +0100)] 
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.

7 days agotest: use log_tests_skipped_errno() at one more place
Yu Watanabe [Sat, 22 Nov 2025 00:46:58 +0000 (09:46 +0900)] 
test: use log_tests_skipped_errno() at one more place

Follow-up for 12d2abe0827ad62652d0cb1791c89f3d2adbb280.

7 days agomeson: Still build libshared even if libmount is disabled 39871/head
Daan De Meyer [Mon, 24 Nov 2025 09:57:58 +0000 (10:57 +0100)] 
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.

7 days agotest-reread-partition-table: Don't keep open fds around
Daan De Meyer [Mon, 24 Nov 2025 10:53:12 +0000 (11:53 +0100)] 
test-reread-partition-table: Don't keep open fds around

Avoids EBUSY from BLKRRPART when built without libblkid support.

7 days agotest-reread-partition-table: Only check for CAP_SYS_ADMIN
Daan De Meyer [Mon, 24 Nov 2025 11:51:14 +0000 (12:51 +0100)] 
test-reread-partition-table: Only check for CAP_SYS_ADMIN

We might have CAP_SYS_ADMIN even without being root.

7 days agotests: Assume we're running in a chroot if check fails
Daan De Meyer [Mon, 24 Nov 2025 12:07:39 +0000 (13:07 +0100)] 
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.

7 days agotree-wide: replace tab with space, adjust missing or duplicated space
Yu Watanabe [Mon, 24 Nov 2025 03:59:22 +0000 (12:59 +0900)] 
tree-wide: replace tab with space, adjust missing or duplicated space

7 days agooomd: move check if processes can be killed into oomd_cgroup_kill()
Yu Watanabe [Sat, 22 Nov 2025 01:19:47 +0000 (10:19 +0900)] 
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 38e9d40c8097363b1e8fa025ef06865dadb0a3ac.

7 days agoman,doc: add uapi spec numbers to all links to uapi specs (#39867)
Luca Boccassi [Mon, 24 Nov 2025 11:15:09 +0000 (11:15 +0000)] 
man,doc: add uapi spec numbers to all links to uapi specs (#39867)

7 days agocrash-handler: also disable dlopen(), just in case 39824/head
Lennart Poettering [Thu, 20 Nov 2025 13:43:41 +0000 (14:43 +0100)] 
crash-handler: also disable dlopen(), just in case

7 days agoprocess-util: also disable dlopen() in safe_fork()
Lennart Poettering [Thu, 20 Nov 2025 13:43:22 +0000 (14:43 +0100)] 
process-util: also disable dlopen() in safe_fork()

7 days agocore: load libcryptsetup before forking off child that might need it
Lennart Poettering [Mon, 24 Nov 2025 08:41:36 +0000 (09:41 +0100)] 
core: load libcryptsetup before forking off child that might need it

7 days agosysext: load libraries before forking off worker child
Lennart Poettering [Fri, 21 Nov 2025 16:09:54 +0000 (17:09 +0100)] 
sysext: load libraries before forking off worker child

7 days agorepart: load libraries before forking off child
Lennart Poettering [Fri, 21 Nov 2025 16:09:21 +0000 (17:09 +0100)] 
repart: load libraries before forking off child

7 days agoudev: load a bunch of libs before we fork off worker processes
Lennart Poettering [Fri, 21 Nov 2025 07:53:44 +0000 (08:53 +0100)] 
udev: load a bunch of libs before we fork off worker processes

7 days agodissect-image: load library before we fork off metadata extractor child process
Lennart Poettering [Fri, 21 Nov 2025 07:53:28 +0000 (08:53 +0100)] 
dissect-image: load library before we fork off metadata extractor child process

7 days agoportabled: load a bunch of libs before we fork off a dissector child processes
Lennart Poettering [Fri, 21 Nov 2025 07:53:14 +0000 (08:53 +0100)] 
portabled: load a bunch of libs before we fork off a dissector child processes

7 days agopid1: pull in libmount unconditionally
Lennart Poettering [Mon, 24 Nov 2025 08:55:46 +0000 (09:55 +0100)] 
pid1: pull in libmount unconditionally

7 days agoexecute: load a bunch of libs before we disable dlopen()
Lennart Poettering [Mon, 24 Nov 2025 08:55:03 +0000 (09:55 +0100)] 
execute: load a bunch of libs before we disable dlopen()

7 days agonspawn: load three libraries we'll need later before we fork() a child
Lennart Poettering [Wed, 19 Nov 2025 16:23:58 +0000 (17:23 +0100)] 
nspawn: load three libraries we'll need later before we fork() a child

7 days agodlfcn-util: let's make our dlopen() code fail if we enter a container namespace
Lennart Poettering [Wed, 19 Nov 2025 16:13:50 +0000 (17:13 +0100)] 
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.

7 days agohwdb: Add alternative mode for Beacn Mic (#39868)
Craig McLure [Mon, 24 Nov 2025 06:02:10 +0000 (06:02 +0000)] 
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.

8 days agoman: always prefix links to uapi specs with their UAPI.XY spec number 39867/head
Lennart Poettering [Sun, 23 Nov 2025 17:07:13 +0000 (18:07 +0100)] 
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

8 days agodocs: reference UAPI specs by their number when linked
Lennart Poettering [Sun, 23 Nov 2025 16:16:09 +0000 (17:16 +0100)] 
docs: reference UAPI specs by their number when linked

8 days agofirstboot: drop redundant and spurious errno check
Yu Watanabe [Sun, 23 Nov 2025 06:04:26 +0000 (15:04 +0900)] 
firstboot: drop redundant and spurious errno check

Follow-up for 2319154a6bec7b8c42e901dfacaefe95bf4e3750.

8 days agoboot: ensure profile IDs do not get leaked and overwritten when there are tries suffixes
Luca Boccassi [Sat, 22 Nov 2025 00:25:21 +0000 (00:25 +0000)] 
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 4301ad00ef715885be5c3bdf84c152030b7d36ff

8 days agocore/selinux-setup: actually skip setup gracefully when libselinux is not available...
Yu Watanabe [Sun, 23 Nov 2025 00:11:32 +0000 (09:11 +0900)] 
core/selinux-setup: actually skip setup gracefully when libselinux is not available (#39859)

8 days agodocs: Document cast formatting rules
Daan De Meyer [Sat, 22 Nov 2025 21:50:39 +0000 (22:50 +0100)] 
docs: Document cast formatting rules

9 days agocore/selinux-setup: actually skip setup gracefully when libselinux is not available 39859/head
Mike Yuan [Thu, 20 Nov 2025 19:07:32 +0000 (20:07 +0100)] 
core/selinux-setup: actually skip setup gracefully when libselinux is not available

Follow-up for 83b6ef9b62765b11bc602eae906ff13a5464a638

9 days agocore/exec-invoke: deduplicate needs_setuid with needs_sandboxing
Mike Yuan [Thu, 20 Nov 2025 12:52:51 +0000 (13:52 +0100)] 
core/exec-invoke: deduplicate needs_setuid with needs_sandboxing

9 days agoclang-tidy: Enable misc-include-cleaner check (#39835)
Yu Watanabe [Sat, 22 Nov 2025 11:54:28 +0000 (20:54 +0900)] 
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.

9 days agoclang-tidy: Enable misc-include-cleaner check 39835/head
Daan De Meyer [Tue, 20 May 2025 10:28:15 +0000 (12:28 +0200)] 
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.

9 days agoclang-tidy: Fix all remaining misc-include-cleaner violations
Daan De Meyer [Fri, 23 May 2025 11:38:45 +0000 (13:38 +0200)] 
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

9 days agotest-journald-config: Modernize test
Daan De Meyer [Thu, 20 Nov 2025 18:15:14 +0000 (19:15 +0100)] 
test-journald-config: Modernize test

9 days agoVarious logging fixlets (#39837)
Zbigniew Jędrzejewski-Szmek [Sat, 22 Nov 2025 09:14:10 +0000 (10:14 +0100)] 
Various logging fixlets (#39837)

9 days agoNEWS: drop one sentence
Yu Watanabe [Sat, 22 Nov 2025 01:43:14 +0000 (10:43 +0900)] 
NEWS: drop one sentence

We have agreed the bump.

9 days agoUse SD_JSON_BUILD_PAIR_* macros if possible in shared/core/home (#39845)
Yu Watanabe [Sat, 22 Nov 2025 01:04:02 +0000 (10:04 +0900)] 
Use SD_JSON_BUILD_PAIR_* macros if possible in shared/core/home (#39845)

9 days agopam-systemd-home: various logging cleanups 39837/head
Yu Watanabe [Fri, 21 Nov 2025 00:51:29 +0000 (09:51 +0900)] 
pam-systemd-home: various logging cleanups

9 days agopam-systemd-loadkey: append full stop
Yu Watanabe [Fri, 21 Nov 2025 00:31:36 +0000 (09:31 +0900)] 
pam-systemd-loadkey: append full stop

9 days agopam-systemd: various fixlets for logging
Yu Watanabe [Fri, 21 Nov 2025 00:23:11 +0000 (09:23 +0900)] 
pam-systemd: various fixlets for logging

- Do not use '%m' when errno is not set.
- Do not use pam_syslog_errno() when errno is not set.
- Use pam_debug_syslog_errno() rather than log_debug_errno().
- Use 0 rather than PAM_SUCCESS in the function that returns negative
  errno, though PAM_SUCCESS == 0, hence that does not change any
  behavior.
- Append missing full stop in the log message.

9 days agopam-util: make pam_debug_syslog_errno() returns pam error
Yu Watanabe [Fri, 21 Nov 2025 00:21:25 +0000 (09:21 +0900)] 
pam-util: make pam_debug_syslog_errno() returns pam error

Currently, the result of pam_debug_syslog_errno() is unused, hence this
does not change anything and may be slightly redundant. But let's follow
our usual coding style.

9 days agopam-util: use correct errno
Yu Watanabe [Fri, 21 Nov 2025 00:11:34 +0000 (09:11 +0900)] 
pam-util: use correct errno

- pam_log_oom() passes ENOMEM rather than -ENOMEM, hence previously
  pam_log_oom() did not return PAM_BUF_ERR.
- We may (mistakenly) pass SYNTHETIC_ERRNO(). Let's gracefully handle that.
- Introduce errno_to_pam_error() helper function.

9 days agoapparmor: update log message
Yu Watanabe [Thu, 20 Nov 2025 23:40:17 +0000 (08:40 +0900)] 
apparmor: update log message

Follow-up for c3b3eea2e56d7904ace7dd72c8520933ebef843e.
Addresses https://github.com/systemd/systemd/pull/39826#discussion_r2547327325.

10 days agotest: skip test-reread-partition-table if missing privileges
Nick Rosbrook [Fri, 21 Nov 2025 17:49:37 +0000 (12:49 -0500)] 
test: skip test-reread-partition-table if missing privileges

Right now, this test runs inside unprivileged chroots, despite the
running_in_chroot() check. This is because running_in_chroot() fails
with -EACCES, which is ignored.

Hence, check for privileges before calling running_in_chroot(),
otherwise call is inconclusive. Note, the test will fail later on if
running without privileges anyways.

10 days agotest: check for all errors in test-reread-partition-table
Luca Boccassi [Fri, 21 Nov 2025 17:53:46 +0000 (17:53 +0000)] 
test: check for all errors in test-reread-partition-table

Otherwise if opening the loop dev fails, the test segfaults
dereferencing a NULL variable later

Follow-up for 757887d01dd96125be1774f4b23b12f2fbda9a8b

10 days agoresolve: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR() 39845/head
Jelle van der Waa [Fri, 21 Nov 2025 16:07:45 +0000 (17:07 +0100)] 
resolve: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR()

No functional change, just refactoring.

10 days agohome: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR()
Jelle van der Waa [Fri, 21 Nov 2025 16:01:54 +0000 (17:01 +0100)] 
home: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR()

No functional change, just refactoring.

10 days agoshared: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR()
Jelle van der Waa [Fri, 21 Nov 2025 15:59:30 +0000 (16:59 +0100)] 
shared: prefer using SD_JSON_BUILD_PAIR_* over SD_JSON_BUILD_PAIR()

No functional change, just refactoring.

10 days agonspawn: Fix broken host links for container journals (#39727)
Chris Down [Fri, 21 Nov 2025 15:42:23 +0000 (23:42 +0800)] 
nspawn: Fix broken host links for container journals (#39727)

Commit 88252ca changed nspawn to always run from a temporary mount
directory (e.g., /tmp/nspawn-root-XXXXXX). This was a good
simplification for mount logic, but it unintentionally broke the
--link-journal feature.

The setup_journal() helper was subsequently passed this ephemeral path
instead of the persistent machine path (from --directory= or --image=).
This caused the host to create broken symlinks pointing to a temporary
directory that would soon be gone.

Fix this by storing the original path and plumbing it through to
setup_journal().

All other mount-related logic in outer_child() continues to use the
temporary `directory` variable.

Fixes: #39472
10 days agonspawn: Add integration test for --link-journal 39727/head
Chris Down [Fri, 14 Nov 2025 08:46:08 +0000 (16:46 +0800)] 
nspawn: Add integration test for --link-journal

10 days agonspawn: Fix broken host links for container journals
Chris Down [Fri, 14 Nov 2025 08:44:49 +0000 (16:44 +0800)] 
nspawn: Fix broken host links for container journals

Commit 88252ca changed nspawn to always run from a temporary mount
directory (e.g., /tmp/nspawn-root-XXXXXX). This was a good
simplification for mount logic, but it unintentionally broke the
--link-journal feature.

The setup_journal() helper was subsequently passed this ephemeral path
instead of the persistent machine path (from --directory= or --image=).
This caused the host to create broken symlinks pointing to a temporary
directory that would soon be gone.

Fix this by storing the original path and plumbing it through to
setup_journal().

All other mount-related logic in outer_child() continues to use the
temporary `directory` variable.

Fixes: #39472
10 days agorun0: Add note about processes having privileges over --empower sessions
Daan De Meyer [Fri, 21 Nov 2025 10:44:30 +0000 (11:44 +0100)] 
run0: Add note about processes having privileges over --empower sessions

10 days agosd-bus: Exit event loop with error code instead of EXIT_FAILURE
Daan De Meyer [Thu, 13 Nov 2025 20:59:18 +0000 (21:59 +0100)] 
sd-bus: Exit event loop with error code instead of EXIT_FAILURE

Instead of failing the event loop with a generic EXIT_FAILURE
error code when exit-on-disconnect is used, let's propagate the
error code instead of swallowing it.

Whereas previously sd_event_loop() would always fail with exit code
'1' when exit-on-disconnect is used with an sd-bus instance registered
with the event loop that encounters a failure, now we'll correctly
propagate the error to sd_event_loop() that caused sd-bus to fail and
exit the event loop. Additionally, the error is now also properly
propagated to outstanding reply callbacks for async dbus calls started
with sd_bus_call_async() and friends, whereas before we always used
ETIMEDOUT for these calls which is extremely confusing for users.

Why is this confusing? We always start sd-bus instances asynchronously,
in other words, sd_bus_start() will not actually wait until the bus instance
is connected, but it'll happen in the background, either driven by the first
sd_bus_call() when there is no event loop or by sd-event when there is an
event loop attached to the sd-bus instance. Assuming an event loop is attached,
when we fail to connect to the bus, the sd-bus instance will close down and the
first async method call we queued will fail with ETIMEDOUT. Nowhere in this process
do we inform the user that we failed to connect to the bus because of e.g. a permission
error, except for a debug log message.

By propagating the error to sd_event_exit() if exit-on-disconnect is enabled
and always propagating it to outstanding reply callbacks, debugging failures
becomes much easier as users will now get the actual error code causing the
bus instance to close down instead of ETIMEDOUT and 1 respectively.

10 days agotest: skip test-loop-block udev part in chroot too
Luca Boccassi [Thu, 20 Nov 2025 14:33:30 +0000 (14:33 +0000)] 
test: skip test-loop-block udev part in chroot too

Same reason as containers, need full udev/uevent machinery for this

10 days agooomd: check if a cgroup can be killed before attempting to kill it
Matteo Croce [Mon, 17 Nov 2025 16:30:34 +0000 (17:30 +0100)] 
oomd: check if a cgroup can be killed before attempting to kill it

On OOM event, oomd tries to kill a cgroup until it succeedes.
The kill can fail with EPERM in case a pid is not killed, this leaves
the cgroup with only half of the processed killed.
This is unlikely but theoretically possible in a user namespace,
where systemd run as root inside the container and tries to kill a
cgroup with some PID from the host namespace.

To address this, send the SIG0 signal to all the processes to check
that we have privileges to kill them.

11 days agoapparmor: move dlopen() into mac_apparmor_use() check (#39826)
Zbigniew Jędrzejewski-Szmek [Thu, 20 Nov 2025 19:10:44 +0000 (20:10 +0100)] 
apparmor: move dlopen() into mac_apparmor_use() check (#39826)

This mirrors what we do for mac_selinux_use(), which also loads
libselinux.

11 days agovirt: debug log when inode_same() fails
Luca Boccassi [Thu, 20 Nov 2025 15:36:39 +0000 (15:36 +0000)] 
virt: debug log when inode_same() fails

If this fails with an error there's no log messages and tests
typically don't log it either as they just check, so add a
message to aid in debugging

11 days agomkosi: Drop IWYU
Daan De Meyer [Thu, 20 Nov 2025 12:18:30 +0000 (13:18 +0100)] 
mkosi: Drop IWYU

We use clang-tidy's include checker, so let's stop installing IWYU.

11 days agobasic/terminal-util: operate on one fd in terminal_get_size_by_dsr()
Zbigniew Jędrzejewski-Szmek [Thu, 20 Nov 2025 13:27:57 +0000 (14:27 +0100)] 
basic/terminal-util: operate on one fd in terminal_get_size_by_dsr()

This moves the open call earlier, so that we do any state-changing operations
if we actually managed to open the nonblocking fd. This makes the code more
robust because if the fdreopen call fails, we won't make modifications to the
state of the terminal.

11 days agoman: fix typo
Christoph Anton Mitterer [Thu, 20 Nov 2025 15:17:45 +0000 (16:17 +0100)] 
man: fix typo

11 days agomkosi: update fedora commit reference to 12f95f807fef5075a8842dd107f83b4c41d5ac26
Daan De Meyer [Thu, 20 Nov 2025 14:08:15 +0000 (15:08 +0100)] 
mkosi: update fedora commit reference to 12f95f807fef5075a8842dd107f83b4c41d5ac26

12f95f807f Wrap %autosetup in %_build_in_place check
f9916b6fd1 Revert "Use %autosetup -C"
044cff4700 Allow empower group
a0acca210d Version 259~rc1
e455d82fd8 Add various extra explicit Requires
1a7506a105 Version 258.2
256463d690 Restore runlevelX.target units
b17d9c3474 Use %autosetup -C
fe18084a05 Remove hack to stop systemd-networkd-resolve-hook.socket

11 days agolabeler: shell-completion -> "shell completion"
Mike Yuan [Thu, 20 Nov 2025 13:01:31 +0000 (14:01 +0100)] 
labeler: shell-completion -> "shell completion"

The latter is what we actually use. We didn't observe the issue
because the rule was effectively inactive before
bcf95c41161fb4d541002777bd6ab3374d72fe39.

11 days agopam_systemd: fix OSC write failure message appearing in error logs (#39791)
Yu Watanabe [Thu, 20 Nov 2025 14:07:00 +0000 (23:07 +0900)] 
pam_systemd: fix OSC write failure message appearing in error logs (#39791)