Commit Graph

82348 Commits

Author SHA1 Message Date
Lennart Poettering
7478fbb0af core: fixes for RandomizedOffsetSec= feature (#37981)
Fixes: #37870
Follow-up for: #36437
2025-06-26 22:58:22 +02:00
Luca Boccassi
f00c2ac34a 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
2025-06-26 17:27:04 +01:00
Lennart Poettering
c6bb846c04 shared: make sure RandomizedOffsetUSec can be set as transient prop
Fixes: #37870
Follow-up for: #36437
2025-06-26 17:31:00 +02:00
Lennart Poettering
99fd08224f man: add proper version info for RandomizedOffsetUSec
Follow-up for: #36437
Fixes: #37870
2025-06-26 17:28:49 +02:00
Lennart Poettering
d14cfb6e82 repart: enforce minimum size on ESP based on sector size (#37899)
Fixes: #37801
2025-06-26 17:22:47 +02:00
Lennart Poettering
584e5222d2 fix docs for inhibitor logic (#37975)
Fixes: #34091

Sigh.
2025-06-26 17:22:08 +02:00
Luca Boccassi
4cce53b76a Small udpates to TPM2_PCR_MEASUREMENTS page (#37978) 2025-06-26 14:28:03 +01:00
Lennart Poettering
7620f70464 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
2025-06-26 15:21:01 +02:00
Lennart Poettering
2cdaad5b3b 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
2025-06-26 15:21:01 +02:00
Lennart Poettering
c343f0ee13 repart: respect minimum sector size for ESP/VFAT partitions
Fixes: #37801
2025-06-26 14:52:20 +02:00
Lennart Poettering
3982577119 repart: trivial modernizations 2025-06-26 14:36:34 +02:00
Lennart Poettering
e7b4b2968e 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).
2025-06-26 14:36:33 +02:00
Lennart Poettering
76a71fb64d 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
2025-06-26 14:35:16 +02:00
Daan De Meyer
5a6c4e3339 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
2025-06-26 13:28:15 +02:00
Daan De Meyer
1095865d26 tools: Fix fetch-mkosi changelog generation 2025-06-26 13:28:15 +02:00
Zbigniew Jędrzejewski-Szmek
85b84437c8 docs/TPM2_PCR_MEASUREMENTS: fix typo 2025-06-26 12:25:30 +02:00
Zbigniew Jędrzejewski-Szmek
ab7e55f195 docs/TPM2_PCR_MEASUREMENTS: link to the PCR registry page 2025-06-26 12:16:59 +02:00
Jan Čermák
a7bfb9f76b 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
2025-06-26 02:44:59 +09:00
Lennart Poettering
f789b17e87 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
2025-06-26 01:24:52 +09:00
Mike Yuan
9efffbbfde Revert "namespace-util: include sched.h"
This reverts commit 50cda6433b.

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.
2025-06-26 00:46:20 +09:00
Mike Yuan
7c3da8cbf9 Revert "fs-util: include fcntl.h in fs-util.h"
This reverts commit 4d0fe93cba.

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.
2025-06-26 00:46:20 +09:00
Luca Boccassi
f8b598d381 socket-activate: normalize COMMAND notation in help text + man (#37967) 2025-06-25 15:05:24 +01:00
Daan De Meyer
9cb6d2bf85 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.
2025-06-25 14:58:31 +01:00
Mike Yuan
151efb6d13 socket-activate: normalize COMMAND notation in help text + man 2025-06-25 13:34:41 +02:00
Mike Yuan
e6be9d12db man/systemd-run: consistently wrap external command + args in a single block 2025-06-25 13:31:16 +02:00
Yu Watanabe
28cc15135a Assorted header cleanups (#37958) 2025-06-25 06:32:56 +09:00
Luca Boccassi
a0dfb02456 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
2025-06-25 05:44:13 +09:00
Lennart Poettering
736b627775 logind: save position only if we have a seat 2025-06-24 22:16:41 +02:00
Lennart Poettering
2be3a06bb2 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
2025-06-24 22:16:01 +02:00
Yu Watanabe
aecb6eaed7 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.
2025-06-24 21:04:58 +01:00
Yu Watanabe
38704f5dc9 include: update syscall list
open_tree_attr is since kernel 6.15-rc1:
c4a16820d9
2025-06-25 03:59:25 +09:00
Yu Watanabe
65a7665939 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);
```
2025-06-25 03:59:25 +09:00
Yu Watanabe
4d0fe93cba 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.
2025-06-25 03:59:25 +09:00
Yu Watanabe
118ac16b6e 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.
2025-06-25 00:50:06 +09:00
Yu Watanabe
50cda6433b namespace-util: include sched.h
To make CLONE_NEWNS and friends defined, which is used by clone_flag_to_namespace_type().
2025-06-25 00:50:06 +09:00
Yu Watanabe
8227088e2b meson: sort file list 2025-06-25 00:50:06 +09:00
Yu Watanabe
fbf6836812 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.
2025-06-25 00:50:06 +09:00
Lennart Poettering
51cc3825d1 tree-wide: use sd_bus_message_send() instead of sd_bus_send() wherever possible
Also, add a coccinelle script that patches this automatically.
2025-06-24 23:23:40 +09:00
Lennart Poettering
9422ce83c2 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
2025-06-24 13:10:11 +02:00
Lennart Poettering
7e1647ae4e 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.
2025-06-24 07:31:07 +02:00
Luca Boccassi
078eeac8ea NEWS: add not about vendor import-pubring renaming 2025-06-24 00:15:06 +01:00
Luca Boccassi
18118380c5 mkosi: drop suse spec workarounds that were merged upstream 2025-06-24 00:15:06 +01:00
Luca Boccassi
4da911c1e5 mkosi: workaround for opensuse spec file to pick up new import-pubring filename 2025-06-24 00:15:06 +01:00
Luca Boccassi
c45c77e890 mkosi: update debian commit reference to 84966b99cdfc7ea3ee35163ad224775d9be90055
* 84966b99cd systemd-container: pick up renamed keyring file
* 7aab0da57c udev: add 'clock' system group for PTP rules
2025-06-23 23:24:51 +01:00
Luca Boccassi
857f08137a 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.
2025-06-23 23:24:51 +01:00
Luca Boccassi
ff401d5df9 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.
2025-06-23 23:24:51 +01:00
Yu Watanabe
274e2f4bb9 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.
2025-06-23 22:28:22 +01:00
Lennart Poettering
170d7d49f5 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: e2e1f38f5a
2025-06-23 22:26:24 +01:00
Luca Boccassi
ad39648171 network/dhcp6: handle conflict addresses gracefully (#37916) 2025-06-23 22:23:35 +01:00
Yu Watanabe
4aedee430b core: turn ordering cycle log message into a recognizable one + catalog entry (#37893)
Fixes: #35642
2025-06-24 02:56:07 +09:00