]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
4 months agoTEST-07-PID1: add test cases for DeferTrigger= 37505/head
Mike Yuan [Sun, 18 May 2025 01:40:14 +0000 (03:40 +0200)] 
TEST-07-PID1: add test cases for DeferTrigger=

4 months agounits/systemd-{udevd,journald}*.socket: enable DeferTrigger=
Mike Yuan [Sun, 18 May 2025 00:24:38 +0000 (02:24 +0200)] 
units/systemd-{udevd,journald}*.socket: enable DeferTrigger=

Refer to d766c75acdd825abe1bcfd45406ae2e609a008b6 for the rationale
behind the udevd change.

systemd-journald.service conflicts with soft-reboot.target,
so make sure anything surviving soft-reboot and trying
to log to journal doesn't fail the socket units.

4 months agocore/socket: introduce DeferTrigger= and DeferTriggerMaxSec=
Mike Yuan [Fri, 16 May 2025 16:10:46 +0000 (18:10 +0200)] 
core/socket: introduce DeferTrigger= and DeferTriggerMaxSec=

Alternative to b50f6dbe574b0421db7dbf200ad951186382277d

The commit naively returned early from socket_enter_running(), which however
is quite problematic, as the socket will be woken up over and over again
without doing a thing, until we eventually hit Poll/TriggerLimit*=.
On top of that it requires hacks to hold the start job for initrd-switch-root.service
up. Overall I doubt that is the right approach.

Let's instead hook this into our job engine, and try to activate
the service again when some other units are stopped. If all installed
jobs have been run yet we're still seeing the conflict or the manually
selected timeout is reached, fail the socket as before.

4 months agocore/transaction: add job mode "lenient" as an even weaker version of _FAIL
Mike Yuan [Sun, 18 May 2025 17:54:51 +0000 (19:54 +0200)] 
core/transaction: add job mode "lenient" as an even weaker version of _FAIL

4 months agounits/initrd-cleanup.service: drop --job-mode=replace-irreversibly hack
Mike Yuan [Mon, 30 Jun 2025 10:47:21 +0000 (12:47 +0200)] 
units/initrd-cleanup.service: drop --job-mode=replace-irreversibly hack

This partially reverts d766c75acdd825abe1bcfd45406ae2e609a008b6.

The offending commit tries to block systemd-udevd.service
from being activated during switch-root, but it is a dirty hack
and causes problems with e.g. Ctrl-Alt-Delete handling which
actually need to start a conflicting target. Let's revert
this here, and the original issue will be resolved in a cleaner
fashion in later commits.

4 months agocore/socket: use ERROR_IS_NEG_* at one more place
Mike Yuan [Fri, 16 May 2025 16:17:18 +0000 (18:17 +0200)] 
core/socket: use ERROR_IS_NEG_* at one more place

4 months agocore/unit: correct indentation
Mike Yuan [Thu, 22 May 2025 18:24:08 +0000 (20:24 +0200)] 
core/unit: correct indentation

Follow-up for 54e1f676a2d3fa8c39beac84fe5027d9276d491d

4 months agonspawn: Add --bind-user-shell= to control shells for --bind-user
Nick Labich [Fri, 27 Jun 2025 15:39:46 +0000 (11:39 -0400)] 
nspawn: Add --bind-user-shell= to control shells for --bind-user

Prior to this change, no user shell can be specified in the user
records passed into a container via --bind-user=. This new option
allows users to:

1. When false (the default), continue to specify no user shell for
   each bound user record, resulting in the use of the container's
   default shell for bound users.

2. When true, include each host user's shell in the corresponding
   user record passed into a container (via --bind-user=).

3. When an absolute path, set that path as the user shell for each
   user record passed into a container (via --bind-user=).

This does not change the existing behavior, but allows users to
opt-in to either copy the shells specified by the host user records
or override the shell explicitly by path.

4 months agorepart: add support for `Format=empty`
Michael Ferrari [Fri, 27 Jun 2025 16:26:10 +0000 (18:26 +0200)] 
repart: add support for `Format=empty`

This is a new meta value for the `Format=` option, which is equivalent
as specifying `Label=_empty` and `NoAuto=1` for compatibility with
sd-sysupdate.

Closes: https://github.com/systemd/systemd/issues/34596
4 months agovmspawn: Use host_device driver for --extra-drive block devices
Nick Labich [Fri, 27 Jun 2025 15:52:09 +0000 (11:52 -0400)] 
vmspawn: Use host_device driver for --extra-drive block devices

Extra drives attached to VMs use the file driver for regular files and the
host_device driver for block devices.

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

4 months agotree-wide: include unistd.h where necessary
Yu Watanabe [Tue, 24 Jun 2025 19:51:20 +0000 (04:51 +0900)] 
tree-wide: include unistd.h where necessary

We use symbols provided by unistd.h without including it. E.g.
open(), close(), read(), write(), access(), symlink(), unlink(), rmdir(),
fsync(), syncfs(), lseek(), ftruncate(), fchown(), dup2(), pipe2(),
getuid(), getgid(), gettid(), getppid(), pipe2(), execv(), _exit(),
environ, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO, F_OK, and their
friends and variants, so on.

Currently, unistd.h is indirectly included mainly in the following two paths:
- through missing_syscall.h, which is planned to covert to .c file.
- through signal.h -> bits/sigstksz.h, which is new since glibc-2.34.
  Note, signal.h is included by sd-eevent.h. So, many source files
  indirectly include unistd.h if newer glibc is used.

Currently, our baseline on glibc is 2.31. We need to support glibc older
than 2.34, but unfortunately, we do not have any CI environments with
such old glibc. CIFuzz uses glibc-2.31, but it builds only fuzzers, and
many files are even not compiled.

4 months agoconf-files: several follow-ups for #37972 (#37997)
Yu Watanabe [Mon, 30 Jun 2025 03:47:49 +0000 (12:47 +0900)] 
conf-files: several follow-ups for #37972 (#37997)

The PR #37972 was merged without final review by mistake, and has
several issues.
This reverts some of the commits in the PR, and fix several issues.

4 months agoTEST-17-UDEV: check the exit code at last 37997/head
Yu Watanabe [Sat, 28 Jun 2025 01:39:32 +0000 (10:39 +0900)] 
TEST-17-UDEV: check the exit code at last

Otherwise, it is hard to debug when the test failed.

4 months agoconf-files: fix an empty root handling in conf_files_list_strv()
Yu Watanabe [Sat, 28 Jun 2025 01:25:05 +0000 (10:25 +0900)] 
conf-files: fix an empty root handling in conf_files_list_strv()

Before 50c81130b69d04288f50217bede709bac6ca2b1a, the function used
chase(), hence if root is an empty string, each config directory made
prefixed with the current working directory if it is relative. See
implementation of chase().

With 50c81130b69d04288f50217bede709bac6ca2b1a, conf_files_list_strv()
internally uses chaseat(), hence each config directory is not prefixed
anymore even if it is relative.

To restore the previous behavior, this makes
- if root is an empty string, prefix each config directories with the
  current working directory if relative.
- if root is relative, make it absolute to make the prefixed results also
  absolute, and debugging logs show absolute paths.
- use chaseat_prefix_root() to prefix the results, for safety.

Follow-ups for 50c81130b69d04288f50217bede709bac6ca2b1a.

4 months agopath-util: move empty_or_root_to_null() from chase.c
Yu Watanabe [Sat, 28 Jun 2025 11:55:11 +0000 (20:55 +0900)] 
path-util: move empty_or_root_to_null() from chase.c

And rename it to empty_or_root_harder_to_null(), as it also checks if
the input path effectively points to the root by calling path_is_root().
This also adds simple test cases for the function.

4 months agoconf-files: fstatat() sets errno on failure
Yu Watanabe [Sat, 28 Jun 2025 02:00:56 +0000 (11:00 +0900)] 
conf-files: fstatat() sets errno on failure

Follow-up for 50c81130b69d04288f50217bede709bac6ca2b1a.

4 months agoRevert "conf-files: introduce CONF_FILES_CHASE_BASENAME flag"
Yu Watanabe [Sat, 28 Jun 2025 14:03:44 +0000 (23:03 +0900)] 
Revert "conf-files: introduce CONF_FILES_CHASE_BASENAME flag"

This reverts commit 49653adef3ff47c7bcd1098c763eb2a55297df15.

The commit was merged without review, and has several issues.
Let's revert the change now, and address the issue pointed out by
the commit later in another way.

4 months agoconf-files: drop use of CONF_FILES_CHASE_BASENAME in conf_files_list_with_replacement()
Yu Watanabe [Sat, 28 Jun 2025 13:58:05 +0000 (22:58 +0900)] 
conf-files: drop use of CONF_FILES_CHASE_BASENAME in conf_files_list_with_replacement()

The flag has several potential issues, and will be dropped in the next
commit.

Follow-up for 41fb58595a22d50ca79278a64de4bff28f6dfd24.

4 months agoRevert "pretty-print: also chase symlinks in the last component"
Yu Watanabe [Sat, 28 Jun 2025 13:54:04 +0000 (22:54 +0900)] 
Revert "pretty-print: also chase symlinks in the last component"

This reverts commit 2f2977cab8ee94e5479d86c93c7a4346789a920a.

The commit was mistakenly merged without review. Also as pointed at
https://github.com/systemd/systemd/pull/37972#discussion_r2173234198
now the output is confusing. Let's revert at least now.

4 months agoRevert "tree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified"
Yu Watanabe [Sat, 28 Jun 2025 13:52:22 +0000 (22:52 +0900)] 
Revert "tree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified"

This reverts commit 6b606f3586db64a1010a64921d302028134e1902.

The commit was mistakenly merged without review, and has several issues.
Let's revert at least now.

4 months agomeson: drop custom_target names (#38003)
Yu Watanabe [Sat, 28 Jun 2025 20:58:26 +0000 (05:58 +0900)] 
meson: drop custom_target names (#38003)

4 months agomeson: adjust indentation 38003/head
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 15:18:35 +0000 (17:18 +0200)] 
meson: adjust indentation

4 months agomeson: drop explicit custom_target names
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 15:14:50 +0000 (17:14 +0200)] 
meson: drop explicit custom_target names

[1] says:
> Since 0.60.0 the name argument is optional and defaults to the basename of
> the first output
We specify >= 0.62 as the supported version, so drop the duplicate name in all cases
where it is the same as outputs[0], i.e. almost all cases.

[1] https://mesonbuild.com/Reference-manual_functions.html#custom_target

4 months agoman: drop inadvertently added -x, make shellcheck clean
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 13:31:46 +0000 (15:31 +0200)] 
man: drop inadvertently added -x, make shellcheck clean

aecb6eaed7d39d73f296c86a882c644b18b7e634 added -x most likely for debugging,
drop it. Also, adjust quoting to make the generated scripts liked by shellcheck.

4 months agomeson: quote paths in generated systemd-runtest.env
Zbigniew Jędrzejewski-Szmek [Sat, 28 Jun 2025 13:10:00 +0000 (15:10 +0200)] 
meson: quote paths in generated systemd-runtest.env

Looking at aecb6eaed7d39d73f296c86a882c644b18b7e634, it seems that we
want build paths with spaces to be supported. Let's use 'printf %q' here
to make that work. Also, use capture:true to make the command less complicated.

4 months agorepart: fix typo
Yu Watanabe [Fri, 27 Jun 2025 19:32:27 +0000 (04:32 +0900)] 
repart: fix typo

Follow-up for e7b4b2968e0e3752cdde290c57fe208eab9f6265.

4 months agotest-conf-files: use ASSERT_OK() and friends 37972/head
Yu Watanabe [Fri, 27 Jun 2025 19:12:27 +0000 (04:12 +0900)] 
test-conf-files: use ASSERT_OK() and friends

4 months agotree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified
Yu Watanabe [Fri, 27 Jun 2025 01:42:24 +0000 (10:42 +0900)] 
tree-wide: use CONF_FILES_CHASE_BASENAME where root directory is specified

Otherwise, the result may point to outside of the root directory.

This also sets CONF_FILES_REGULAR and CONF_FILES_FILTER_MASKED, as the
callers will call fopen() or friends for the result, thus the enumerated
results must be non-empty regular files.

4 months agopretty-print: also chase symlinks in the last component
Yu Watanabe [Fri, 27 Jun 2025 01:07:21 +0000 (10:07 +0900)] 
pretty-print: also chase symlinks in the last component

Otherwise, this may shows files outside of the specified root directory.

4 months agoconf-files: rework conf_files_list_with_replacement()
Yu Watanabe [Thu, 26 Jun 2025 18:45:56 +0000 (03:45 +0900)] 
conf-files: rework conf_files_list_with_replacement()

Previously, symlinks in the replacement was not chased, hence we may
inserted a path to outside of the root directory, or we may have wrong
judgement whether we should insert the replacement or not.

This makes the symlinks in the replacement also resolved.
Also, as the function is only used by tmpfiles and sysusers, this
enables CONF_FILES_REGULAR, CONF_FILES_CHASE_BASENAME, and
CONF_FILES_FILTER_MASKED_BY_SYMLINK flags.

4 months agoconf-files: introduce CONF_FILES_CHASE_BASENAME flag
Yu Watanabe [Fri, 27 Jun 2025 00:20:08 +0000 (09:20 +0900)] 
conf-files: introduce CONF_FILES_CHASE_BASENAME flag

Previously, when a root directory is specified to conf_files_list() and
friends, the last component of each result was not resolved, even though
they internally chases the last component. So the caller needs to chase
the path again when the file is used.

This introduce a new flag that makes the whole path of each result is
resolved, hence caller can use it as is.

4 months agoconf-files: chase symlink files in conf directories
Yu Watanabe [Thu, 26 Jun 2025 16:18:35 +0000 (01:18 +0900)] 
conf-files: chase symlink files in conf directories

Previously, symlinks in paths to conf directories are chased, but
symlink files in conf directories were not.

This also makes symlink files in conf directories chased. And, any
unresolvable symlinks are dropped, even if no verification is requested.

4 months agouserdb: fix enumeration of .membership files
Yu Watanabe [Thu, 26 Jun 2025 00:42:16 +0000 (09:42 +0900)] 
userdb: fix enumeration of .membership files

The man page nss-systemd(8) says

> The contents of these files are currently not read, and the files
> should be created empty.

But previously we filtered out such files, as the CONF_FILES_FILTER_MASKED
flag checks if a file is empty (or symlink to null), thus any empty files
were ignored.

To accept empty .membership files, let's use CONF_FILES_FILTER_MASKED_BY_SYMLINK.

Fixes #37945.

4 months agoconf-files: split CONF_FILES_FILTER_MASKED flag into two
Yu Watanabe [Thu, 26 Jun 2025 13:52:17 +0000 (22:52 +0900)] 
conf-files: split CONF_FILES_FILTER_MASKED flag into two

4 months agostat-util: split null_or_empty() into two
Yu Watanabe [Thu, 26 Jun 2025 13:49:31 +0000 (22:49 +0900)] 
stat-util: split null_or_empty() into two

4 months agotest-xml: migrate to new assertion macros (#37990)
Yaping Li [Fri, 27 Jun 2025 18:53:12 +0000 (11:53 -0700)] 
test-xml: migrate to new assertion macros (#37990)

We recently added a new set of assertion macros such as ASSERT_GE,
ASSERT_OK, ASSERT_EQ, ... which show not only the expression that failed
but also the values of the arguments of the expression. Let's use them.

4 months agobasic/include: trivial cleanups for libc header wrapper (#37937)
Mike Yuan [Fri, 27 Jun 2025 14:03:10 +0000 (16:03 +0200)] 
basic/include: trivial cleanups for libc header wrapper (#37937)

4 months agoresolved: don't wait for TLS close_notify replies unnecessarily
Lennart Poettering [Thu, 26 Jun 2025 10:22:41 +0000 (12:22 +0200)] 
resolved: don't wait for TLS close_notify replies unnecessarily

This is based on #35764 by Guruswamy Basavaiah, but covers further code
paths.

This ensures that when we initiate a TLS shutdown we'll write out our
own close_notify message, but not wait for the close_notify reply from
the server side anymore.

Replaces: #35764

4 months agoresolved: when determining error to return, prefer "conclusive" over "inconclusive...
Lennart Poettering [Thu, 26 Jun 2025 21:04:07 +0000 (23:04 +0200)] 
resolved: when determining error to return, prefer "conclusive" over "inconclusive" errors

When asked to look something up, and all scopes we contact fail we need
to pick a suitable error code for the failure, and given that we look up
things on multiple scopes we might have multiple errors to choose from.
So far we simply picked the error from the last scope in the list, which
hence would be pretty arbitrary.

Let's tweak this a bit, and if we have multiple errors to choose from,
let's prefer "conclusive" failures over "inconclusive" ones. The
"inconclusive" ones in this sense are the ones where we didn't even issue
a request, but couldn't even do that because we had no server, no
network or things like that. The "conclusive" ones are the errors we got
from a server, that hence a "real" in a way.

This addresses the confusion described in #37969. For LLMNR lookups we
generally refuse looking up A addresses via IPv6 and AAAA via IPv4. This
generates a DNS_TRANSACTION_NO_SERVERS error, which we would then return
for one type of lookup but not for the other, because the IPv6 scope is
generally created after the IPv4 one, and hence so far won.

Fixes: #37969
4 months agocpu-set-util: fix null pointer dereference and several cleanups (#37900)
Lennart Poettering [Fri, 27 Jun 2025 12:59:25 +0000 (14:59 +0200)] 
cpu-set-util: fix null pointer dereference and several cleanups (#37900)

Fixes CID#1611618.

4 months agotimer: Do not recalculate monotonic elapse time on clock change
Fleuria [Thu, 3 Apr 2025 13:18:38 +0000 (20:18 +0700)] 
timer: Do not recalculate monotonic elapse time on clock change

The only clock change that affects monotonic timers is suspend causing
CLOCK_MONOTONIC to fall behind CLOCK_BOOTTIME. However, monotonic timers
that use CLOCK_BOOTTIME are not intended to have their elapse time
changed after a suspend. Hence condition the calculation of monotonic
timers’ elapse times on the cause not being a clock change.

Fixes #29245

4 months agotest-network: wait for all addresses and routes configured before start monitoring
Yu Watanabe [Thu, 26 Jun 2025 21:23:09 +0000 (06:23 +0900)] 
test-network: wait for all addresses and routes configured before start monitoring

Otherwise, kernel may announce configuration of an address or route
after 'ip monitor' is started.

This also makes the test check if the whole output of 'ip monitor' is
empty. Otherwise, if the test fails, it is hard to find what is wrong.

Follow-ups for 912a48572de1411cff2964452e0d7a021b43921f and
bcb9e72b6bf57d6d2aec581fedc4a33d6d826e2f.

Fixes #37982.

4 months agohwdb: Add accel orientation quirk for the Microtech e-tab Pro
Andy Shevchenko [Thu, 26 Jun 2025 22:08:45 +0000 (01:08 +0300)] 
hwdb: Add accel orientation quirk for the Microtech e-tab Pro

Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
4 months agocore: fixes for RandomizedOffsetSec= feature (#37981)
Lennart Poettering [Thu, 26 Jun 2025 20:58:22 +0000 (22:58 +0200)] 
core: fixes for RandomizedOffsetSec= feature (#37981)

Fixes: #37870
Follow-up for: #36437

4 months agomkosi: update mkosi commit reference to 0d1143150835b21c1bfe64428df5f45b558280b1...
Luca Boccassi [Thu, 26 Jun 2025 16:27:04 +0000 (17:27 +0100)] 
mkosi: update mkosi commit reference to 0d1143150835b21c1bfe64428df5f45b558280b1 (#37977)

b2fe7ba6b1 Do not use return in finally
b4f3088535 Ensure directories exist before running sync scripts
e83e7036b0 mkosi-obs: also allow enrolling additional certs in KEK
b6432fbc29 initrd: Copy /etc/pki/rpm-gpg into sandbox tree
44b96b93c8 Partially revert "resources: add systemd-boot-efi"
7a22260179 Check that keys are both in context.cli and history
6570b21a4b fix: Remove `erofs-utils` from initrd
ff61c5022a mkosi-initrd: Add atkbd and i8042 modules to the default
initrd modules
eaa37f7c6c Generate initrds outside of umask context manager
de09209520 ci: Drop differential shellcheck
d07c6b93c9 build(deps): bump github/codeql-action from 3.28.16 to
3.28.18
9a12fb1bef Check that commit exists in config_parse_minimum_version()
9e5b4f8932 kmod: factor out comparison and also count empty
directories as invalid
39ed5ef6c2 apt: support including additional configuration for
reprepro

4 months agoshared: make sure RandomizedOffsetUSec can be set as transient prop 37981/head
Lennart Poettering [Thu, 26 Jun 2025 15:31:00 +0000 (17:31 +0200)] 
shared: make sure RandomizedOffsetUSec can be set as transient prop

Fixes: #37870
Follow-up for: #36437

4 months agoman: add proper version info for RandomizedOffsetUSec
Lennart Poettering [Thu, 26 Jun 2025 15:28:44 +0000 (17:28 +0200)] 
man: add proper version info for RandomizedOffsetUSec

Follow-up for: #36437
Fixes: #37870
4 months agorepart: enforce minimum size on ESP based on sector size (#37899)
Lennart Poettering [Thu, 26 Jun 2025 15:22:47 +0000 (17:22 +0200)] 
repart: enforce minimum size on ESP based on sector size (#37899)

Fixes: #37801
4 months agofix docs for inhibitor logic (#37975)
Lennart Poettering [Thu, 26 Jun 2025 15:22:08 +0000 (17:22 +0200)] 
fix docs for inhibitor logic (#37975)

Fixes: #34091
Sigh.

4 months agoSmall udpates to TPM2_PCR_MEASUREMENTS page (#37978)
Luca Boccassi [Thu, 26 Jun 2025 13:28:03 +0000 (14:28 +0100)] 
Small udpates to TPM2_PCR_MEASUREMENTS page (#37978)

4 months agologind: introduce a proper error if op is blocked by inhibitor lock 37975/head
Lennart Poettering [Thu, 26 Jun 2025 09:33:26 +0000 (11:33 +0200)] 
logind: introduce a proper error if op is blocked by inhibitor lock

We map it client side to EACCES, because that's what systemctl wants for
its logic.

See: #34091

4 months agodocs: properly document inhibitor locks
Lennart Poettering [Thu, 26 Jun 2025 09:17:23 +0000 (11:17 +0200)] 
docs: properly document inhibitor locks

I still am annoyed that this wasn't documented properly when the
inhibitor locks where modified, even though raised multiple times in PR
reviews.

Follow-up for: #30307
See: #34091

4 months agorepart: respect minimum sector size for ESP/VFAT partitions 37899/head
Lennart Poettering [Wed, 25 Jun 2025 09:02:05 +0000 (11:02 +0200)] 
repart: respect minimum sector size for ESP/VFAT partitions

Fixes: #37801
4 months agorepart: trivial modernizations
Lennart Poettering [Thu, 19 Jun 2025 12:42:55 +0000 (14:42 +0200)] 
repart: trivial modernizations

4 months agorepart: make file system sector size configurable
Lennart Poettering [Thu, 19 Jun 2025 12:14:31 +0000 (14:14 +0200)] 
repart: make file system sector size configurable

Let's make the fs sector size configurable. This also adds
infrastructure so that we can pick different sector sizes as defaults
eventually, but doesn't actually do that.

(Background: I think we should probably default to native sector size
for the ESP, but Daan disagrees, so I'll leave this out for now).

4 months agoboot: downgrade log messages about invalid timeouts
Lennart Poettering [Thu, 26 Jun 2025 08:59:10 +0000 (10:59 +0200)] 
boot: downgrade log messages about invalid timeouts

We correctly handle invalid timeouts being stored in EFI variables, but
because we deal with this gracefully we should downgrade the log level
to warning, and say "ignoring" in the log message.

Inspired by #34084

4 months agomkosi: update mkosi commit reference to 0d1143150835b21c1bfe64428df5f45b558280b1 37977/head
Daan De Meyer [Thu, 26 Jun 2025 11:27:39 +0000 (13:27 +0200)] 
mkosi: update mkosi commit reference to 0d1143150835b21c1bfe64428df5f45b558280b1

b2fe7ba6b1 Do not use return in finally
b4f3088535 Ensure directories exist before running sync scripts
e83e7036b0 mkosi-obs: also allow enrolling additional certs in KEK
b6432fbc29 initrd: Copy /etc/pki/rpm-gpg into sandbox tree
44b96b93c8 Partially revert "resources: add systemd-boot-efi"
7a22260179 Check that keys are both in context.cli and history
6570b21a4b fix: Remove `erofs-utils` from initrd
ff61c5022a mkosi-initrd: Add atkbd and i8042 modules to the default initrd modules
eaa37f7c6c Generate initrds outside of umask context manager
de09209520 ci: Drop differential shellcheck
d07c6b93c9 build(deps): bump github/codeql-action from 3.28.16 to 3.28.18
9a12fb1bef Check that commit exists in config_parse_minimum_version()
9e5b4f8932 kmod: factor out comparison and also count empty directories as invalid
39ed5ef6c2 apt: support including additional configuration for reprepro

4 months agotools: Fix fetch-mkosi changelog generation
Daan De Meyer [Thu, 26 Jun 2025 11:28:01 +0000 (13:28 +0200)] 
tools: Fix fetch-mkosi changelog generation

4 months agodocs/TPM2_PCR_MEASUREMENTS: fix typo 37978/head
Zbigniew Jędrzejewski-Szmek [Thu, 26 Jun 2025 10:25:30 +0000 (12:25 +0200)] 
docs/TPM2_PCR_MEASUREMENTS: fix typo

4 months agodocs/TPM2_PCR_MEASUREMENTS: link to the PCR registry page
Zbigniew Jędrzejewski-Szmek [Thu, 26 Jun 2025 10:16:59 +0000 (12:16 +0200)] 
docs/TPM2_PCR_MEASUREMENTS: link to the PCR registry page

4 months agojournal-gatewayd: fix handling of num_skip pointing beyond the last entry
Jan Čermák [Tue, 24 Jun 2025 16:54:44 +0000 (18:54 +0200)] 
journal-gatewayd: fix handling of num_skip pointing beyond the last entry

When `num_skip` is supplied to the `Range` header, journal-gatewayd
always returns the very last record even though it should have been
skipped. This is because the `sd_journal_next_skip` always returns
non-zero value on the first call, leading to one iteration of the
`request_reader_entries` returning the last record.

To avoid this unexpected behavior, check that the number of lines we
have skipped by is not lower than the requested skip value. If it is,
then it means there are lines which should not be returned now -
decrement the n_skip counter then and return from the function, closing
the stream if follow flag is not set.

Fixes #37954

4 months agoterminal-util: switch from TCSADRAIN to TCSANOW for all tcsetattr() calls
Lennart Poettering [Wed, 25 Jun 2025 09:49:47 +0000 (11:49 +0200)] 
terminal-util: switch from TCSADRAIN to TCSANOW for all tcsetattr() calls

TCSADRAIN means tcsetattr() will become blocking (waiting for ability to
write out queued bytes), which is problematic, if the referenced TTY is
dead for some reason.

Since all these calls just modify *input* parameters anyway (i.e. mostly
local echo, and canonical mode), forcing out queued output is kinda
pointless anyway, hence just don't do it: leave it in the queue and just
change the flags we want to change.

The tcsetattr(3) man page kinda hints that we want to use TCSANOW here,
because it documents for TCSADRAIN:

"This option should be used when changing parameters that affect
output."

Which one can read so that TCSADRAIN should not be used if it doesn't
affect output, which is the case here.

This probably fixes: #37854

4 months agoRevert "namespace-util: include sched.h"
Mike Yuan [Wed, 25 Jun 2025 11:15:55 +0000 (13:15 +0200)] 
Revert "namespace-util: include sched.h"

This reverts commit 50cda6433bb04bf6ad81bde3b5d19d2856b34575.

Same as the previous revert, sched.h is too generic to
be included in namespace-util.h, plus this defeats
the purpose of forward decl.

4 months agoRevert "fs-util: include fcntl.h in fs-util.h"
Mike Yuan [Wed, 25 Jun 2025 11:04:47 +0000 (13:04 +0200)] 
Revert "fs-util: include fcntl.h in fs-util.h"

This reverts commit 4d0fe93cbaf01fcc2a61f51bb36cd4b07394bab8.

I'm not convinced by the reasoning here. The practice of
forward declarations should be confined in headers only,
and any actual invocation of functions in source files
needs to include the original header. strv_split_full()
for instance takes ExtractFlags, and callers will need
to include extract-word.h to get the value definitions.

Now, indeed some -util headers export the most relevant
system header too, notably pidfd-util. But fs-util doesn't
seem to be coupled with any specific header, hence I'm
skeptical about such inclusion.

4 months agosocket-activate: normalize COMMAND notation in help text + man (#37967)
Luca Boccassi [Wed, 25 Jun 2025 14:05:24 +0000 (15:05 +0100)] 
socket-activate: normalize COMMAND notation in help text + man (#37967)

4 months agonspawn: Allow bpf() syscall if CAP_BPF is retained
Daan De Meyer [Wed, 25 Jun 2025 11:19:59 +0000 (13:19 +0200)] 
nspawn: Allow bpf() syscall if CAP_BPF is retained

CAP_BPF is closely associated with the bpf() syscall so it makes sense
to allow the latter if the former is retained.

4 months agosocket-activate: normalize COMMAND notation in help text + man 37967/head
Mike Yuan [Wed, 25 Jun 2025 11:32:19 +0000 (13:32 +0200)] 
socket-activate: normalize COMMAND notation in help text + man

4 months agoman/systemd-run: consistently wrap external command + args in a single block
Mike Yuan [Wed, 25 Jun 2025 11:31:16 +0000 (13:31 +0200)] 
man/systemd-run: consistently wrap external command + args in a single block

4 months agoAssorted header cleanups (#37958)
Yu Watanabe [Tue, 24 Jun 2025 21:32:56 +0000 (06:32 +0900)] 
Assorted header cleanups (#37958)

4 months agotest: escape '+' from uname -r before using in regex via '=~'
Luca Boccassi [Tue, 24 Jun 2025 12:07:11 +0000 (13:07 +0100)] 
test: escape '+' from uname -r before using in regex via '=~'

It will otherwise interpret characters such as '+' as if they
were regex, and break matching.

For example TEST-71-HOSTNAME started failing when
uname -r started including a '+':

FAIL: 'Kernel: Linux 6.12.33+deb13-amd64' not found in:
 Static hostname: host
       Icon name: computer-vm
         Chassis: vm 🖴
      Machine ID: e6471c1f95ab49098827498ed816cdf7
         Boot ID: 231da987f64d4af59f2076fbb638c611
  Virtualization: kvm
Operating System: Debian GNU/Linux 13 (trixie)
          Kernel: Linux 6.12.33+deb13-amd64
    Architecture: x86-64

4 months agologind: save position only if we have a seat
Lennart Poettering [Thu, 22 May 2025 16:04:25 +0000 (18:04 +0200)] 
logind: save position only if we have a seat

4 months agocore: when PrivateDevices= is enabled and we need to decrypt TPM2 credentials, go...
Lennart Poettering [Mon, 2 Jun 2025 11:31:29 +0000 (13:31 +0200)] 
core: when PrivateDevices= is enabled and we need to decrypt TPM2 credentials, go via IPC

Also, if a device ACL list is defined, also go via IPC (instead of
trying to patch it, as before).

The outcome is that the tighter rules continue to apply when configured.

Fixes: #35959
4 months agoman: fix @BUILD_ROOT@ insertion
Yu Watanabe [Tue, 24 Jun 2025 17:31:48 +0000 (02:31 +0900)] 
man: fix @BUILD_ROOT@ insertion

@BUILD_ROOT@ is replaced with the _quoted_ build path. Hence, if
@BUILD_ROOT@ is quoted, the result is doubly quoted, and the script does
not work if the path contains spaces.

Fixes #37953.

4 months agoinclude: update syscall list 37958/head
Yu Watanabe [Thu, 19 Jun 2025 00:09:17 +0000 (09:09 +0900)] 
include: update syscall list

open_tree_attr is since kernel 6.15-rc1:
https://github.com/torvalds/linux/commit/c4a16820d90199409c9bf01c4f794e1e9e8d8fd8

4 months agofs-util: use int for argument that takes F_OK and friends
Yu Watanabe [Sat, 21 Jun 2025 16:40:25 +0000 (01:40 +0900)] 
fs-util: use int for argument that takes F_OK and friends

access_nofollow() is a simple wrapper of faccessat(), and it is defined as
```
int faccessat(int dirfd, const char *pathname, int mode, int flags);
```

4 months agofs-util: include fcntl.h in fs-util.h
Yu Watanabe [Sat, 21 Jun 2025 16:34:36 +0000 (01:34 +0900)] 
fs-util: include fcntl.h in fs-util.h

fs-util.h provides access_nofollow() but it did not include neither
fcntl.h nor unistd.h, which define F_OK and friends. Hence we cannot use
the function without including one of the headers. Let's include fcntl.h
in fs-util.h, then we can use the function by simply including fs-util.h.

4 months agoinclude: import kernel headers for several struct and enum definitions
Yu Watanabe [Thu, 19 Jun 2025 20:40:29 +0000 (05:40 +0900)] 
include: import kernel headers for several struct and enum definitions

- mempolicy.h for MPOL_DEFAULT and friends,
- sched/types.h for struct sched_attr,
- xattr.h for struct xattr_args.

4 months agonamespace-util: include sched.h
Yu Watanabe [Thu, 19 Jun 2025 20:44:06 +0000 (05:44 +0900)] 
namespace-util: include sched.h

To make CLONE_NEWNS and friends defined, which is used by clone_flag_to_namespace_type().

4 months agomeson: sort file list
Yu Watanabe [Thu, 19 Jun 2025 20:37:44 +0000 (05:37 +0900)] 
meson: sort file list

4 months agotree-wide: include missing_fs.h only where necessary
Yu Watanabe [Thu, 19 Jun 2025 15:59:32 +0000 (00:59 +0900)] 
tree-wide: include missing_fs.h only where necessary

The additional definitions provided by the header are
- EXT4_IOC_RESIZE_FS, used in resize-fs.c,
- FILEID_KERNFS, used in cgroup-util.c and pidfd-util.c.

Let's drop the inclusion at other places.

4 months agotree-wide: use sd_bus_message_send() instead of sd_bus_send() wherever possible
Lennart Poettering [Tue, 24 Jun 2025 11:07:54 +0000 (13:07 +0200)] 
tree-wide: use sd_bus_message_send() instead of sd_bus_send() wherever possible

Also, add a coccinelle script that patches this automatically.

4 months agoinclude: add comment why our sys/mount.h does not include the one by glibc 37937/head
Yu Watanabe [Mon, 23 Jun 2025 06:43:04 +0000 (15:43 +0900)] 
include: add comment why our sys/mount.h does not include the one by glibc

4 months agoinclude: make system headers self contained
Yu Watanabe [Mon, 23 Jun 2025 03:02:50 +0000 (12:02 +0900)] 
include: make system headers self contained

Let's not include any non-system headers in system headers.

4 months agoudev: reset loopback block device ownership and mode on detach
Lennart Poettering [Thu, 19 Jun 2025 15:18:11 +0000 (17:18 +0200)] 
udev: reset loopback block device ownership and mode on detach

Loopback block devices are agressively reused, without being removed in
between. This means various inode attributes on their device nodes will
– so far – remain in effect between uses of the devices. Since there are
applications which change access mode/ownership of such devices after
attaching files to them, let's undo this again when we detect them to be
unused again.

Fixes: #37745
4 months agoimport: rename keyring extension from .gpg to .pgp and add OBS key for system:systemd...
Lennart Poettering [Tue, 24 Jun 2025 05:31:07 +0000 (07:31 +0200)] 
import: rename keyring extension from .gpg to .pgp and add OBS key for system:systemd (#37927)

The format is not specific to gpg, it's defined by the pgp
protocols. Lintian even warns about it:

systemd-container: openpgp-file-has-implementation-specific-extension
[usr/lib/systemd/import-pubring.gpg]

Rename it accordingly, as new pgp implementations are slowly becoming
more popular.

Keep using /etc/systemd/import-pubring.gpg for backward compatibility.

4 months agoNEWS: add not about vendor import-pubring renaming 37927/head
Luca Boccassi [Mon, 23 Jun 2025 22:24:33 +0000 (23:24 +0100)] 
NEWS: add not about vendor import-pubring renaming

4 months agomkosi: drop suse spec workarounds that were merged upstream
Luca Boccassi [Mon, 23 Jun 2025 22:14:16 +0000 (23:14 +0100)] 
mkosi: drop suse spec workarounds that were merged upstream

4 months agomkosi: workaround for opensuse spec file to pick up new import-pubring filename
Luca Boccassi [Sun, 22 Jun 2025 17:18:53 +0000 (18:18 +0100)] 
mkosi: workaround for opensuse spec file to pick up new import-pubring filename

4 months agomkosi: update debian commit reference to 84966b99cdfc7ea3ee35163ad224775d9be90055
Luca Boccassi [Sun, 22 Jun 2025 17:12:32 +0000 (18:12 +0100)] 
mkosi: update debian commit reference to 84966b99cdfc7ea3ee35163ad224775d9be90055

84966b99cd systemd-container: pick up renamed keyring file
7aab0da57c udev: add 'clock' system group for PTP rules

4 months agoimport-pubring: add OBS key for system:systemd
Luca Boccassi [Sun, 22 Jun 2025 16:52:02 +0000 (17:52 +0100)] 
import-pubring: add OBS key for system:systemd

We are publishing ParticleOS images at
https://build.opensuse.org/project/show/system:systemd

so add the signing key to the default keyring, so that they
can be imported out of the box.

4 months agoimport: rename keyring extension from .gpg to .pgp
Luca Boccassi [Sun, 22 Jun 2025 16:43:35 +0000 (17:43 +0100)] 
import: rename keyring extension from .gpg to .pgp

The format is not specific to gpg, it's defined by the pgp
protocols. Lintian even warns about it:

systemd-container: openpgp-file-has-implementation-specific-extension [usr/lib/systemd/import-pubring.gpg]

Rename it accordingly, as new pgp implementations are slowly becoming
more popular.

Keep using /etc/systemd/import-pubring.gpg for backward compatibility.

4 months agotest-cpu-set-util: fix check for CPUSet.allocated
Yu Watanabe [Sat, 21 Jun 2025 14:06:16 +0000 (23:06 +0900)] 
test-cpu-set-util: fix check for CPUSet.allocated

The check was simply wrong and meaningless, as it always checked
CPUSet.allocated is greater than or equals to 1, as sizeof(__cpu_mask) is 8.

Let's make the test more strict.

4 months agouser-record: also support "aliases" in the "status" section of user records
Lennart Poettering [Fri, 13 Jun 2025 08:08:25 +0000 (10:08 +0200)] 
user-record: also support "aliases" in the "status" section of user records

Some user record providers might want to implement case-insensitive user
record matching, or other forms of non-normalized matching. So far
uderdb didn't allow that, because client's typically revalidate the
returned user records against the search keys (at least our clients do)
– they check if the search user name is actually part of the user record
and its aliases.

In order to support such lookups we thus need to allow the looup keys to
be part of the user record, but also not be persisted in it, because
the number of casings/spellings of a username might be ridiculously
high.

A nice way out is to allow "aliases" not only in the main part of the
record, but also in the "status" part, that contains information
dynamically determined at query time. We can insert a second "aliases"
field there, which the parser will then merge with the primary "aliases"
field, but the existing rules around "status" ensure tha the data is
never persisted.

Follow-up: e2e1f38f5a9d442d0a027986024f4ea75ce97d2f

4 months agonetwork/dhcp6: handle conflict addresses gracefully (#37916)
Luca Boccassi [Mon, 23 Jun 2025 21:23:35 +0000 (22:23 +0100)] 
network/dhcp6: handle conflict addresses gracefully (#37916)

4 months agocore: turn ordering cycle log message into a recognizable one + catalog entry (#37893)
Yu Watanabe [Mon, 23 Jun 2025 17:56:07 +0000 (02:56 +0900)] 
core: turn ordering cycle log message into a recognizable one + catalog entry (#37893)

Fixes: #35642
4 months agoglob-util: several cleanups for safe_glob() (#37933)
Yu Watanabe [Mon, 23 Jun 2025 17:53:37 +0000 (02:53 +0900)] 
glob-util: several cleanups for safe_glob() (#37933)

4 months agohome: Make sure we resolve /etc/skel symlink
Daan De Meyer [Sun, 22 Jun 2025 12:17:08 +0000 (14:17 +0200)] 
home: Make sure we resolve /etc/skel symlink

Otherwise copy_tree_at() will try to copy the symlink which we obviously
don't want.

4 months agohomed,userdbd: mark "secrets" section of user records always to "sensitive" (#37935)
Yu Watanabe [Mon, 23 Jun 2025 15:50:44 +0000 (00:50 +0900)] 
homed,userdbd: mark "secrets" section of user records always to "sensitive" (#37935)

4 months agobootspec: ensure memory free in one error path
Lennart Poettering [Mon, 23 Jun 2025 12:40:21 +0000 (14:40 +0200)] 
bootspec: ensure memory free in one error path

4 months agosysupdate: use path_is_safe()
Yu Watanabe [Sun, 22 Jun 2025 05:44:04 +0000 (14:44 +0900)] 
sysupdate: use path_is_safe()

path_is_safe(...) is an alias of path_is_valid_full(..., false).