]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
8 months agodirent-util: introduce simple wrapper of posix_getdents() 36565/head
Yu Watanabe [Mon, 3 Mar 2025 18:11:58 +0000 (03:11 +0900)] 
dirent-util: introduce simple wrapper of posix_getdents()

glibc exports getdents64 syscall as is, but musl exports it as
posix_getdents(). Let's introduce a simple wrapper of posix_getdents().

Note, our baseline for glibc is 2.31. Hence, we can assume getdents64()
always defined when building with glibc.

8 months agobasic: introduce our own sys/mount.h implementation
Yu Watanabe [Mon, 3 Mar 2025 14:26:38 +0000 (23:26 +0900)] 
basic: introduce our own sys/mount.h implementation

To resolve conflict with sys/mount.h and linux/mount.h or linux/fs.h.

The conflict between sys/mount.h and linux/mount.h is resolved in
glibc-2.37 (774058d72942249f71d74e7f2b639f77184160a6), but our baseline
is still glibc-2.31. Also, even with the version or newer, still
sys/mount.h conflicts with linux/fs.h, which is included by
linux/btrfs.h.

This introduces our own implementation of sys/mount.h, that can be
simultaneously included with linux/mount.h and linux/fs.h. This also
imports linux/fs.h, linux/mount.h, and several other dependent headers.
The introduced sys/mount.h header itself may not be enough simple, but
by using the header, we can drop most of workarounds in other source files.

8 months agomissing_audit: AUDIT_NLGRP_READLOG is defined since kernel v3.16
Yu Watanabe [Fri, 28 Feb 2025 20:34:23 +0000 (05:34 +0900)] 
missing_audit: AUDIT_NLGRP_READLOG is defined since kernel v3.16

More specifically, since 451f921639fea4600dfb9ab2889332bdcc7b48d3.
Now, our kernel baseline is 5.4. Hence, we can drop the definition.

8 months agobasic/linux: import capability.h from kernel 6.14-rc4
Yu Watanabe [Fri, 28 Feb 2025 20:24:48 +0000 (05:24 +0900)] 
basic/linux: import capability.h from kernel 6.14-rc4

8 months agomissing_wait: add short comment about P_PIDFD
Yu Watanabe [Fri, 28 Feb 2025 20:13:32 +0000 (05:13 +0900)] 
missing_wait: add short comment about P_PIDFD

8 months agomissing_timerfd: TFD_TIMER_CANCEL_ON_SET is defined since glibc-2.26
Yu Watanabe [Fri, 28 Feb 2025 20:09:58 +0000 (05:09 +0900)] 
missing_timerfd: TFD_TIMER_CANCEL_ON_SET is defined since glibc-2.26

8 months agomissing_threads.h: threads.h exists since glibc-2.28
Yu Watanabe [Fri, 28 Feb 2025 19:57:49 +0000 (04:57 +0900)] 
missing_threads.h: threads.h exists since glibc-2.28

8 months agomissing_socket: drop unnecessary definitions
Yu Watanabe [Fri, 28 Feb 2025 19:47:31 +0000 (04:47 +0900)] 
missing_socket: drop unnecessary definitions

All removed definitions are in glibc-2.31

8 months agomissing_securebits: remove unnecessary header
Yu Watanabe [Fri, 28 Feb 2025 19:37:01 +0000 (04:37 +0900)] 
missing_securebits: remove unnecessary header

Our kernel baseline is 5.4, hence all entries in the headers are defined
in linux/securebits.h.

8 months agomissing_resource.h: RLIMIT_RTTIME is defined since glibc-2.14
Yu Watanabe [Fri, 28 Feb 2025 19:14:28 +0000 (04:14 +0900)] 
missing_resource.h: RLIMIT_RTTIME is defined since glibc-2.14

Now our baseline is glibc-2.31.

8 months agobasic/linux: import prctl.h from linux 6.14-rc4
Yu Watanabe [Fri, 28 Feb 2025 19:01:07 +0000 (04:01 +0900)] 
basic/linux: import prctl.h from linux 6.14-rc4

8 months agomissing_network: drop unnecessary definitions
Yu Watanabe [Fri, 28 Feb 2025 18:55:14 +0000 (03:55 +0900)] 
missing_network: drop unnecessary definitions

They are already defined in glibc-2.31.

8 months agomissing_namespace: drop unnecessary entries
Yu Watanabe [Fri, 28 Feb 2025 18:50:46 +0000 (03:50 +0900)] 
missing_namespace: drop unnecessary entries

Our kernel baseline is 5.4.

8 months agobasic/linux: import loop.h from kernel 6.14-rc4, and drop missing_loop.h
Yu Watanabe [Fri, 28 Feb 2025 18:43:33 +0000 (03:43 +0900)] 
basic/linux: import loop.h from kernel 6.14-rc4, and drop missing_loop.h

8 months agomissing_keyctl: import keyctl.h from kernel 6.14-rc4
Yu Watanabe [Fri, 28 Feb 2025 18:38:23 +0000 (03:38 +0900)] 
missing_keyctl: import keyctl.h from kernel 6.14-rc4

8 months agobasic/linux: import ioprio.h from kernel 6.14-rc4
Yu Watanabe [Fri, 28 Feb 2025 18:09:43 +0000 (03:09 +0900)] 
basic/linux: import ioprio.h from kernel 6.14-rc4

This also fixes the maximum allowed ioprio class: 8 -> 7

8 months agomissing_input: replace the header with genuine linux header
Yu Watanabe [Fri, 28 Feb 2025 18:02:00 +0000 (03:02 +0900)] 
missing_input: replace the header with genuine linux header

8 months agobasic/linux: import hidraw.h and hid.h from linux-6.14-rc4
Yu Watanabe [Fri, 28 Feb 2025 17:54:35 +0000 (02:54 +0900)] 
basic/linux: import hidraw.h and hid.h from linux-6.14-rc4

8 months agomissing_fs: drop unnecessary entries
Yu Watanabe [Fri, 28 Feb 2025 17:50:07 +0000 (02:50 +0900)] 
missing_fs: drop unnecessary entries

Now our kernel baseline is 5.4.

8 months agomissing_fcntl: drop definitions covered by glibc-2.31
Yu Watanabe [Fri, 28 Feb 2025 17:40:45 +0000 (02:40 +0900)] 
missing_fcntl: drop definitions covered by glibc-2.31

Note, this also fixes the definition for O_TMPFILE for parisc and hppa,
it should be 040000000 (seven zeros) rather than 0400000000 (eight zeros).

8 months agomeson: cleanup glibc header checkers
Yu Watanabe [Fri, 28 Feb 2025 16:05:05 +0000 (01:05 +0900)] 
meson: cleanup glibc header checkers

8 months agomissing_type: char16_t and char32_t are always defined in uchar.h since C11
Yu Watanabe [Fri, 28 Feb 2025 15:08:35 +0000 (00:08 +0900)] 
missing_type: char16_t and char32_t are always defined in uchar.h since C11

Now, we use C17, hence the fallback definitions can be dropped.

8 months agomissing_stdlib: secure_getenv() exists since glibc-2.17
Yu Watanabe [Fri, 28 Feb 2025 16:07:35 +0000 (01:07 +0900)] 
missing_stdlib: secure_getenv() exists since glibc-2.17

8 months agoalloc-util: reallocarray() exists since glibc-2.26
Yu Watanabe [Fri, 28 Feb 2025 15:15:56 +0000 (00:15 +0900)] 
alloc-util: reallocarray() exists since glibc-2.26

8 months agomemory-util: explicit_bzero() exists since glibc-2.25
Yu Watanabe [Fri, 28 Feb 2025 15:14:24 +0000 (00:14 +0900)] 
memory-util: explicit_bzero() exists since glibc-2.25

8 months agomissing_syscall: drop unnecessary definition of AT_EMPTY_PATH
Yu Watanabe [Mon, 3 Mar 2025 04:25:52 +0000 (13:25 +0900)] 
missing_syscall: drop unnecessary definition of AT_EMPTY_PATH

It is defined since glibc-2.14 (46998f745736b3c8df5901a27b6c2a19f5cc5e98),
and the value was never changed.

8 months agomissing_syscall: drop unnecessary ifdefs for syscall number
Yu Watanabe [Mon, 3 Mar 2025 04:15:34 +0000 (13:15 +0900)] 
missing_syscall: drop unnecessary ifdefs for syscall number

Nowadays, we define syscall numbers for newer syscalls.
Hence the conditions are not necessary.

This also adds several comments about when syscalls are introduced.

8 months agomissing_syscall: drop unnecessary syscall number definitions
Yu Watanabe [Mon, 3 Mar 2025 04:07:21 +0000 (13:07 +0900)] 
missing_syscall: drop unnecessary syscall number definitions

8 months agomissing_syscall: drop unused rt_sigqueueinfo wrapper
Yu Watanabe [Mon, 3 Mar 2025 02:42:10 +0000 (11:42 +0900)] 
missing_syscall: drop unused rt_sigqueueinfo wrapper

The syscall is unused since 19e1a908b512410e0968fec9259a8fc221001f12.

8 months agomissing_syscall: copy_file_range is supported by glibc since 2.27
Yu Watanabe [Fri, 28 Feb 2025 13:57:42 +0000 (22:57 +0900)] 
missing_syscall: copy_file_range is supported by glibc since 2.27

Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

8 months agomissing_syscall: renameat2 is supported by glibc since 2.28
Yu Watanabe [Fri, 28 Feb 2025 13:50:32 +0000 (22:50 +0900)] 
missing_syscall: renameat2 is supported by glibc since 2.28

Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

8 months agomissing_syscall: setns is supported by glibc since 2.14
Yu Watanabe [Fri, 28 Feb 2025 13:45:25 +0000 (22:45 +0900)] 
missing_syscall: setns is supported by glibc since 2.14

Also, CLONE_PIDFD is defined in sched.h since 2.31.
Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

8 months agomissing_syscall: name_to_handle_at is supported by glibc since 2.14
Yu Watanabe [Fri, 28 Feb 2025 13:30:42 +0000 (22:30 +0900)] 
missing_syscall: name_to_handle_at is supported by glibc since 2.14

Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

8 months agomissing_syscall: gettid is supported by glibc since 2.30
Yu Watanabe [Fri, 28 Feb 2025 13:27:32 +0000 (22:27 +0900)] 
missing_syscall: gettid is supported by glibc since 2.30

Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

8 months agomissing_syscall: getrandom is supported by glibc since 2.25
Yu Watanabe [Fri, 28 Feb 2025 13:17:01 +0000 (22:17 +0900)] 
missing_syscall: getrandom is supported by glibc since 2.25

Now our baseline of glibc is 2.31, hence it is OK to drop our
definition.

8 months agomissing_syscall: memfd_create() is supported by glibc since 2.27
Yu Watanabe [Fri, 28 Feb 2025 12:49:03 +0000 (21:49 +0900)] 
missing_syscall: memfd_create() is supported by glibc since 2.27

Now, our baseline of glibc is 2.31, hence it is OK to drop it.

8 months agomount-tool: various tweaks (#36584)
Lennart Poettering [Mon, 3 Mar 2025 12:57:27 +0000 (13:57 +0100)] 
mount-tool: various tweaks (#36584)

Split out from #36337

8 months agotty-askpw-agent: react to SIGTERM while waiting for console (#36568)
Lennart Poettering [Mon, 3 Mar 2025 12:56:44 +0000 (13:56 +0100)] 
tty-askpw-agent: react to SIGTERM while waiting for console (#36568)

I noticed that systemd-tty-password-agent would time out when asked to
stop via SIGTERM, and eventually be killed, under some circumstances. It
took me a while but i figured out what was going on:

systemd-ask-pw-agent blocks SIGTERM because it wants async notifications
on SIGTERM via signalfd() to listen on. That mostly works great: except
for one case: if we actually get a pw query request, and hence need to
acquire the terminal: we issue open_terminal() in that case, but if the
terminal is used otherwsie we'll hang, and because SIGTERM is blocked
we'll hang and cannot exit cleanly.

Address that: optionally, in open_terminal() look for SIGTERM by
unblcking the signal mask via ppoll() while we wait.

8 months agoio-util: fix ppoll_usec() bypass 36568/head
Lennart Poettering [Mon, 3 Mar 2025 08:34:59 +0000 (09:34 +0100)] 
io-util: fix ppoll_usec() bypass

If a non-zero timeout is specified we should not bypass ppoll() even if
no fds are specified, since it will still act as a time based sleep in
that case.

8 months agounits: don't block on terminating agents
Lennart Poettering [Fri, 28 Feb 2025 22:35:14 +0000 (23:35 +0100)] 
units: don't block on terminating agents

Terminating the plymouth/console agents when the wall agent takes over
can happen asynchronously, after all the pw queries are async anyway and
hence can be seen by both the plymouth/console agents and the wall
agent.

By stopping the two agents with "--no-block" we add a bit of robustness,
since trouble of them exiting won't block the wall agent to start.

This addresses the issue the previous commit fixes in a different way.

8 months agotty-askpw-agent: react to SIGTERM while waiting for console
Lennart Poettering [Fri, 28 Feb 2025 22:30:55 +0000 (23:30 +0100)] 
tty-askpw-agent: react to SIGTERM while waiting for console

I noticed that systemd-tty-password-agent would time out when asked to
stop via SIGTERM, and eventually be killed, under some circumstances.
It took me a while but i figured out what was going on:

systemd-ask-pw-agent blocks SIGTERM because it wants async notifications
on SIGTERM via signalfd() to listen on. That mostly works great: except
for one case: if we actually get a pw query request, and hence need to
acquire the terminal: we issue open_terminal() in that case, but if the
terminal is used otherwsie we'll hang, and because SIGTERM is blocked
we'll hang and cannot exit cleanly.

Address that: optionally, in acquire_terminal() look for SIGTERM by
unblcking the signal mask via ppoll() while we wait.

8 months agomount-tool: never bind to device on explicit x-systemd.device-bound=no 36584/head
Mike Yuan [Sat, 15 Feb 2025 17:42:31 +0000 (18:42 +0100)] 
mount-tool: never bind to device on explicit x-systemd.device-bound=no

8 months agomount-tool: correct arg_bind_device check
Mike Yuan [Sun, 23 Feb 2025 16:47:09 +0000 (17:47 +0100)] 
mount-tool: correct arg_bind_device check

8 months agomount-tool: accept fstab-style identifiers for remote what too
Mike Yuan [Fri, 14 Feb 2025 22:41:58 +0000 (23:41 +0100)] 
mount-tool: accept fstab-style identifiers for remote what too

fstab-style identifiers have stable translation to absolute paths
in the file system, hence it makes no sense to reject them
even for remote mounts.

8 months agomount-tool: some modernizations and log message tweaks
Mike Yuan [Fri, 14 Feb 2025 22:45:51 +0000 (23:45 +0100)] 
mount-tool: some modernizations and log message tweaks

8 months agotests: remove cache=unsafe from TEST-64-UDEV-STORAGE
Jörg Behrmann [Sun, 2 Mar 2025 14:52:08 +0000 (15:52 +0100)] 
tests: remove cache=unsafe from TEST-64-UDEV-STORAGE

mkosi switch to the newer -blockdev qemu option in systemd/mkosi#3557 [1], but
cache=unsafe is an option only -drive supports.

Since the qemu-system_x86-64 man page [2] says this, cache.writeback=on is the
default and mkosi setting the other two options to the values corresponding to
unsafe, it should be fine to drop the cache=unsafe option.

┌─────────────┬─────────────────┬──────────────┬────────────────┐
│             │ cache.writeback │ cache.direct │ cache.no-flush │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writeback    │ on              │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│none         │ on              │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│writethrough │ off             │ off          │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│directsync   │ off             │ on           │ off            │
├─────────────┼─────────────────┼──────────────┼────────────────┤
│unsafe       │ on              │ off          │ on             │
└─────────────┴─────────────────┴──────────────┴────────────────┘

[1] https://github.com/systemd/mkosi/pull/3557
[2] https://manpages.ubuntu.com/manpages/noble/en/man1/qemu-system-x86_64.1.html

8 months agocore: DelegateNamespaces= does not depend on seccomp (#36580)
Steve Ramage [Sun, 2 Mar 2025 19:23:36 +0000 (11:23 -0800)] 
core: DelegateNamespaces= does not depend on seccomp (#36580)

8 months agosd-id128: gracefully handle systems where kernel keyring access is blocked
Lennart Poettering [Sun, 2 Mar 2025 06:51:05 +0000 (07:51 +0100)] 
sd-id128: gracefully handle systems where kernel keyring access is blocked

In various scenarios we invoke containers with access to the kernel
keyring blocked. Let's make sure we can handle this properly: when the
invocation ID is stored in in the kernel keyring and we try to read it
and get EPERM we should handle it gracefully, like EOPNOTSUPP.

8 months agoosc-context: several follow-ups (#36579)
Lennart Poettering [Sun, 2 Mar 2025 21:00:09 +0000 (22:00 +0100)] 
osc-context: several follow-ups (#36579)

8 months agovmspawn: switch from -drive to -blockdev option
Jörg Behrmann [Sun, 2 Mar 2025 15:07:54 +0000 (16:07 +0100)] 
vmspawn: switch from -drive to -blockdev option

8 months agocore/main: don't write shutdown OSC context outside of pid1 36579/head
Mike Yuan [Sun, 2 Mar 2025 14:11:29 +0000 (15:11 +0100)] 
core/main: don't write shutdown OSC context outside of pid1

Follow-up for 98c283131cda67c98946ef373e3bb33aa52de59a

8 months agorun: send out TERM= only if actually set
Mike Yuan [Sun, 2 Mar 2025 13:35:59 +0000 (14:35 +0100)] 
run: send out TERM= only if actually set

Follow-up for 4d6eb6441a5332c285e35907894c7d4f3463ba64

8 months agorun: log about osc_context_open_chpriv() failure
Mike Yuan [Sun, 2 Mar 2025 13:45:28 +0000 (14:45 +0100)] 
run: log about osc_context_open_chpriv() failure

Follow-up for 575922c914c732bb77c99aee54c84dc365d60631

8 months agoosc-context: drop unneeded temporary variable
Mike Yuan [Sun, 2 Mar 2025 15:00:39 +0000 (16:00 +0100)] 
osc-context: drop unneeded temporary variable

8 months agologin/pam_systemd: use isatty_safe()
Mike Yuan [Sun, 2 Mar 2025 15:00:05 +0000 (16:00 +0100)] 
login/pam_systemd: use isatty_safe()

Follow-up for d8069b8add9a2290d7ed85012f8459fccfc632ed

8 months agoRevert "sd-json: add new sd_json_variant_unset_field() call"
Lennart Poettering [Sun, 2 Mar 2025 05:57:25 +0000 (06:57 +0100)] 
Revert "sd-json: add new sd_json_variant_unset_field() call"

This reverts commit b6a2df630701de0bcf77850ced213d7fc3d0c4de.

The functionality is entirely redundant, we already have
sd_json_variant_filter() which does the same, and is in fact even more
powerful, since it takes a list instead of a single field to remove.

8 months agohwdb: Add accel orientation quirk for the GPD Pocket 4
Chris Grant [Sat, 1 Mar 2025 12:14:22 +0000 (01:14 +1300)] 
hwdb: Add accel orientation quirk for the GPD Pocket 4

8 months agohwdb: add Code Mercenaries Hard- und Software GmbH Virtual RC USB
Jaroslav Škarvada [Sat, 1 Mar 2025 12:16:24 +0000 (13:16 +0100)] 
hwdb: add Code Mercenaries Hard- und Software GmbH Virtual RC USB

It's official VRC USB dongle. Make it work in SDL apps, wine,
Steam, ... and fix the erratic mouse events when the dongle is in use.

8 months agoAdd a few more bypass environment variables
Daan De Meyer [Fri, 28 Feb 2025 16:14:49 +0000 (17:14 +0100)] 
Add a few more bypass environment variables

When we're building ParticleOS images, we don't want the package
manager (or mkosi) to run systemd-sysusers, systemd-tmpfiles or
systemctl preset so let's add a few more bypass environment
variables that we can set to have execution of these skipped like
we already have $SYSTEMD_HWDB_UPDATE_BYPASS and $KERNEL_INSTALL_BYPASS.

8 months agocore: Add DelegateNamespaces= (#36532)
Daan De Meyer [Sat, 1 Mar 2025 14:18:45 +0000 (15:18 +0100)] 
core: Add DelegateNamespaces= (#36532)

8 months agobuild(deps): bump github/codeql-action from 3.27.5 to 3.28.10
dependabot[bot] [Sat, 1 Mar 2025 09:57:32 +0000 (09:57 +0000)] 
build(deps): bump github/codeql-action from 3.27.5 to 3.28.10

Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.27.5 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f09c1c0a94de965c15400f5634aa42fac8fb8f88...b56ba49b26e50535fa1e7f7db0f4f7b4bf65d80d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months agobuild(deps): bump ossf/scorecard-action from 2.4.0 to 2.4.1
dependabot[bot] [Sat, 1 Mar 2025 09:57:25 +0000 (09:57 +0000)] 
build(deps): bump ossf/scorecard-action from 2.4.0 to 2.4.1

Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/62b2cac7ed8198b15735ed49ab1e5cf35480ba46...f49aabe0b5af0936a0987cfb85d86b75731b0186)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months agobuild(deps): bump redhat-plumbers-in-action/differential-shellcheck
dependabot[bot] [Sat, 1 Mar 2025 09:57:22 +0000 (09:57 +0000)] 
build(deps): bump redhat-plumbers-in-action/differential-shellcheck

Bumps [redhat-plumbers-in-action/differential-shellcheck](https://github.com/redhat-plumbers-in-action/differential-shellcheck) from 5.4.0 to 5.5.3.
- [Release notes](https://github.com/redhat-plumbers-in-action/differential-shellcheck/releases)
- [Changelog](https://github.com/redhat-plumbers-in-action/differential-shellcheck/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/redhat-plumbers-in-action/differential-shellcheck/compare/cc6721c45a8800cc666de45493545a07a638d121...dd551ce780d8af741f8cd8bab6982667b906b457)

---
updated-dependencies:
- dependency-name: redhat-plumbers-in-action/differential-shellcheck
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
8 months agocore: Add DelegateNamespaces= 36532/head
Daan De Meyer [Tue, 4 Feb 2025 14:48:36 +0000 (15:48 +0100)] 
core: Add DelegateNamespaces=

This delegates one or more namespaces to the service. Concretely,
this setting influences in which order we unshare namespaces. Delegated
namespaces are unshared *after* the user namespace is unshared. Other
namespaces are unshared *before* the user namespace is unshared.

Fixes #35369

8 months agobump minimum required version of glibc to 2.31, and drop many fallback logic around...
Yu Watanabe [Fri, 28 Feb 2025 19:18:17 +0000 (04:18 +0900)] 
bump minimum required version of glibc to 2.31, and drop many fallback logic around statx() (#36558)

glibc-2.31 was released on 2020-02-01, which is more than 5 years ago.
Let's also bump the baseline of glibc.

8 months agodissect: Skip partitions with _empty label
Daan De Meyer [Fri, 28 Feb 2025 12:09:17 +0000 (13:09 +0100)] 
dissect: Skip partitions with _empty label

8 months agohomed: port to notify_recv() + convert to PidRef (#36557)
Lennart Poettering [Fri, 28 Feb 2025 16:00:31 +0000 (17:00 +0100)] 
homed: port to notify_recv() + convert to PidRef (#36557)

Just some refactoring/modernization

8 months agomountpoint-util: make statx() failure critical 36558/head
Yu Watanabe [Fri, 28 Feb 2025 10:28:33 +0000 (19:28 +0900)] 
mountpoint-util: make statx() failure critical

Two error conditions are unreachable, as now both glibc and kernel
support statx(). In other many places, failure in statx() are handled as
critical, even if it is filtered by seccomp or so. Let's follow the same
way here.

8 months agostat-util: drop statx_fallback()
Yu Watanabe [Fri, 28 Feb 2025 10:19:23 +0000 (19:19 +0900)] 
stat-util: drop statx_fallback()

Now both our required baseline of glibc and kernel support statx.

8 months agotest-stat-util: check if linux/stat.h is actually included from sys/stat.h
Yu Watanabe [Fri, 28 Feb 2025 14:28:42 +0000 (23:28 +0900)] 
test-stat-util: check if linux/stat.h is actually included from sys/stat.h

8 months agotree-wide: drop workarounds for statx()
Yu Watanabe [Thu, 27 Feb 2025 17:06:32 +0000 (02:06 +0900)] 
tree-wide: drop workarounds for statx()

struct statx in glibc header was introduced in glibc-2.28
(fd70af45528d59a00eb3190ef6706cb299488fcd), but at that time,
sys/stat.h conflicts with linux/stat.h. Since glibc-2.30
(5dad6ffbb2b76215cfcd38c3001778536ada8e8a), sys/stat.h includes
linux/stat.h if exists.

Since now our baseline of glibc is 2.31. Hence, we can drop workarounds
for struct statx by importing linux/stat.h from newer kernel (v6.14-rc4).

8 months agoREADME: bump supported minimum glibc version to 2.31
Yu Watanabe [Fri, 28 Feb 2025 14:15:16 +0000 (23:15 +0900)] 
README: bump supported minimum glibc version to 2.31

The current glibc versions used by major distributions:
CentOS 9:  2.34
CentOS 10: 2.39
Fedora 40: 2.39
Fedora 41: 2.40
Fedora 42: 2.41
Ubuntu 20.04 LTS (focal): 2.31
Ubuntu 22.04 LTS (jammy): 2.35
Ubuntu 24.04 LTS (noble): 2.39
Ubuntu 24.10 (oracular):  2.40
Debian 11 (Bullseye, oldstable): 2.31
Debian 12 (Bookworm, stable):    2.36
openSUSE SLE-15-SP6: 2.38
openSUSE Tumbleweed: 2.40

Hence, based on our supporting policy, we can bump the base line to 2.31.
This commit does not change anything on our source code. But, will drop
many workarounds for supporting older glibc in later commits.

8 months agobasic/linux: update kernel headers from v6.14-rc4
Yu Watanabe [Fri, 28 Feb 2025 07:38:11 +0000 (16:38 +0900)] 
basic/linux: update kernel headers from v6.14-rc4

8 months agotmpfiles: fix output value assignment
Yu Watanabe [Fri, 28 Feb 2025 11:25:05 +0000 (20:25 +0900)] 
tmpfiles: fix output value assignment

Fixes a bug in 7eeda1da90c79ba420a6d82c1d9589b23048d79f (v256).

8 months agorecurse-dir: fix wrong assertion and error code in log
Yu Watanabe [Fri, 28 Feb 2025 11:22:42 +0000 (20:22 +0900)] 
recurse-dir: fix wrong assertion and error code in log

Fixes a bug in b5a07e524e42d2594174ca1a5b72aa4fdb9af94c (v250).

8 months agohomed: port worker management to PidRef 36557/head
Lennart Poettering [Fri, 28 Feb 2025 08:58:36 +0000 (09:58 +0100)] 
homed: port worker management to PidRef

8 months agopidref: take more fields into account in pidref_compare_func()
Lennart Poettering [Fri, 28 Feb 2025 08:56:02 +0000 (09:56 +0100)] 
pidref: take more fields into account in pidref_compare_func()

8 months agopidref: export hash funcs
Lennart Poettering [Fri, 28 Feb 2025 08:50:29 +0000 (09:50 +0100)] 
pidref: export hash funcs

That way we can use them for definition of additional hash_ops that map
pidrefs to arbitrary other resources.

8 months agohomed: port to notify_recv_with_fds()
Lennart Poettering [Fri, 28 Feb 2025 08:24:52 +0000 (09:24 +0100)] 
homed: port to notify_recv_with_fds()

Found another implementation of the sd_notify() reception. Modernize it.

8 months agonotify-recv: add notify_recv() flavour that returns a split up strv instead of he...
Lennart Poettering [Fri, 28 Feb 2025 08:35:24 +0000 (09:35 +0100)] 
notify-recv: add notify_recv() flavour that returns a split up strv instead of he message text as string

This is useful at various places, since we split up the message as first
thing there anyway.

8 months agoprofile: return earlier if it is loaded from non-bash shell
Yu Watanabe [Fri, 28 Feb 2025 07:26:53 +0000 (16:26 +0900)] 
profile: return earlier if it is loaded from non-bash shell

Follow-up for dadbb34919abd3fefeb5b8ccc9794da9398a2503.

8 months agopo: Translated using Weblate (Lithuanian)
Justinas Kairys [Fri, 28 Feb 2025 08:38:40 +0000 (09:38 +0100)] 
po: Translated using Weblate (Lithuanian)

Currently translated at 70.0% (180 of 257 strings)

Co-authored-by: Justinas Kairys <j.kairys@proton.me>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/lt/
Translation: systemd/main

8 months agotest-network: extend test case for static routes
Yu Watanabe [Thu, 27 Feb 2025 18:24:39 +0000 (03:24 +0900)] 
test-network: extend test case for static routes

- split out verifications into two functions,
- also check the following scenarios:
  * unmanaging an existing interface,
  * re-managing an unmanaged interface,
  * adding a new unmanaged interface,
  * removing an unmanaged interface.

8 months agomkosi: update debian commit reference
Luca Boccassi [Fri, 28 Feb 2025 01:28:34 +0000 (01:28 +0000)] 
mkosi: update debian commit reference

4dab786933 Install new files
a57877706d Install new files
a6a26c4294 Install new files for upstream profile
2cc2784bbe Install new files for upstream
191edb6aa3 d/t/tests-in-lxd: skip test on any setup error
47c0a694b0 systemd-sysv: add Protected: yes
62ed7598fa README: add note about out-of-tree patches being forbidden
dfd1b0409f systemd-resolved: recommend libidn2-0
88291172bc d/rules: ignore more blhc false positives

8 months agoosc-context: fix typo
Yu Watanabe [Fri, 28 Feb 2025 06:51:02 +0000 (15:51 +0900)] 
osc-context: fix typo

Follow-up for 91aa93ec8d213340b7dea8dcd2e3fe5f90265517.

8 months agomachine-id-setup: bhyve also provides a uuid
Dan McGregor [Thu, 27 Feb 2025 22:18:23 +0000 (16:18 -0600)] 
machine-id-setup: bhyve also provides a uuid

When using UEFI with bhyve it behaves similarly to qemu, and provides
a product_uuid. Use it if found, just like with qemu.

8 months agoIssue OSC ANSI sequence whenever we change "context" of a TTY, i.e. acquire privs...
Lennart Poettering [Thu, 27 Feb 2025 21:12:54 +0000 (22:12 +0100)] 
Issue OSC ANSI sequence whenever we change "context" of a TTY, i.e. acquire privs, enter container or VM or similar (#35224)

This is mostly a strawman to get a discussion going regarding how to
communicate to terminal emulators such as ptyxis about run0 (and nspawn,
and vmspawn, and moe) and what it does.

It's hierarchical and I think still relatively simple.

/cc @chergert

8 months agoparse-util: extend the maximum length of nftable identifiers
Yu Watanabe [Thu, 27 Feb 2025 17:28:41 +0000 (02:28 +0900)] 
parse-util: extend the maximum length of nftable identifiers

Since kernel v4.14, more specifically, after the following four commits,
https://github.com/torvalds/linux/commit/e46abbcc05aa8a16b0e7f5c94e86d11af9aa2770
https://github.com/torvalds/linux/commit/b7263e071aba736cea9e71cdf2e76dfa7aebd039
https://github.com/torvalds/linux/commit/387454901bd62022ac1b04e15bd8d4fcc60bbed4
https://github.com/torvalds/linux/commit/615095752100748e221028fc96163c2b78185ae4
the maximum length of nftable identifiers are extended to 255.

Now, our kernel baseline is 5.4, hence we can freely use the extended
name length.

This also modernizes code a bit, and adds test cases.

Closes #36542.

8 months agosbsign: trivial coding style cleanups
Yu Watanabe [Thu, 27 Feb 2025 17:12:26 +0000 (02:12 +0900)] 
sbsign: trivial coding style cleanups

Follow-ups for 8c0098d4861d8a9a617330e30c9ffad099fb641e.

8 months agolibfido2-util: accept cached pin in fido2_generate_hmac_hash()
Martin Wilck [Mon, 17 Feb 2025 17:40:35 +0000 (18:40 +0100)] 
libfido2-util: accept cached pin in fido2_generate_hmac_hash()

fido2_generate_hmac_hash() sets req->keyring to "fido2-pin" when
calling ask_password_auto(), suggesting that a key by this name
can be read from the kernel keyring. But the keyring is never
opened because the ASK_PASSWORD_ACCEPT_CACHED flag is not set.

Set ASK_PASSWORD_ACCEPT_CACHED to allow automated / scripted
setup of encrypted volumes with FIDO2. If the PIN turns out to
be invalid, clear ASK_PASSWORD_ACCEPT_CACHED to avoid retrying
and possible lockout.

8 months agosbsign: Add support for offline signing (#36485)
Lennart Poettering [Thu, 27 Feb 2025 16:34:05 +0000 (17:34 +0100)] 
sbsign: Add support for offline signing (#36485)

Add new options --prepare-offline-signing, --signed-data= and
--signed-data-signature= which allow for offline signing in a
similar manner to pesign.

8 months agounits: measure additional phases into PCR 11 when entering storage target mode or...
Lennart Poettering [Thu, 27 Feb 2025 14:29:48 +0000 (15:29 +0100)] 
units: measure additional phases into PCR 11 when entering storage target mode or factory reset (#36543)

Let's "spoil" access to TPM secrets when we boot into these two modes.
This matters in particular for storagetm: if the host gets exploited
while booted into storage target mode any secrets kept by the TPM might
remain accessible otherwise. By measuring a new "phase" word into PCR 11
we "blow the fuse" however on this boot.

8 months agocore: also issue OSC 3008 from service context 35224/head
Lennart Poettering [Fri, 31 Jan 2025 16:40:46 +0000 (17:40 +0100)] 
core: also issue OSC 3008 from service context

(Note: we also change TEST-13-NSPAWN.machined.sh minimally here, because
it checks for byte precise output of a pty allocated for a service
invocation - which it's not going to get if it claims that the pty is an
all-powerful one. After all this PR ensures that we'll generate the new
OSC sequence on non-dumb terminals associated with services. Hence, set
TERM=dumb explicitly to ensure no ANSI sequences are generated, ever.
Which is a nice test btw that TERM=dumb really does its thing here.)

8 months agoterminal-util: change conditioning in terminal_reset_defensive()
Lennart Poettering [Fri, 31 Jan 2025 14:32:01 +0000 (15:32 +0100)] 
terminal-util: change conditioning in terminal_reset_defensive()

So far we conditioned the logic that issues ansi sequences for resetting
the TTY based on whether something is a pty is not (under the assumption
we need no reset on ptys, since they are shortlived).

This is simply wrong though. The pty that a container getty is invoked
on is generally long-lived: as long as the container is up, and it will
be reused between getty instances/sessions all the time. In such a case
we really should reset properly.

Let's instead make the logic dependent on whether TERM is set to
anything other than "dumb". The previous commit made sure we always set
TERM in a sensible way in systemd-run, hence this
*explicit* logic sounds like a much better choice now, as it mea

8 months agoterminal-util: change 2nd parameter of terminal_reset_defensive() to flags
Lennart Poettering [Fri, 31 Jan 2025 14:30:07 +0000 (15:30 +0100)] 
terminal-util: change 2nd parameter of terminal_reset_defensive() to flags

let's convert the 2nd argumeng form a boolean to a proper flags
parameter. Doesn't change behaviour in anyway, but is more readable, and
prepares ground for adding more flags soon.

8 months agonspawn: set TERM to "dumb" if we are invoked outside of TTY context
Lennart Poettering [Fri, 31 Jan 2025 19:23:39 +0000 (20:23 +0100)] 
nspawn: set TERM to "dumb" if we are invoked outside of TTY context

8 months agorun: tweak logic how we set $TERM for activated services
Lennart Poettering [Fri, 31 Jan 2025 14:06:34 +0000 (15:06 +0100)] 
run: tweak logic how we set $TERM for activated services

There are two cases when we invoke a service on a TTY:

1. We ourselves are connected to a TTY and would intend to enable PTY
   forwarding.
2. We are allocating a TTY but are not ourselves connected to a TTY and
   just want to input/output to pipe or other non-TTY fd.

Let's propagate $TERM only as-is in the first case. In the 2nd case,
let's explicitly set $TERM to "dumb", so that invoked progams do not
issue needless ansi sequences, since we are not propagating them to a
terminal either.

This should be a much safer result, for cases where people include
invocations of systemd-nspawn with full TTY allocation in a shell
pipeline or so.

(of course, the user can always explicitly override this)

8 months agoprofile: generate shell + command OSC events
Lennart Poettering [Thu, 30 Jan 2025 14:09:21 +0000 (15:09 +0100)] 
profile: generate shell + command OSC events

8 months agopam_systemd: issue context OSC sequences when allocating new TTY session
Lennart Poettering [Thu, 30 Jan 2025 12:45:55 +0000 (13:45 +0100)] 
pam_systemd: issue context OSC sequences when allocating new TTY session

note: this also adds making a copy of the session type string after
registering the session. That's because we need to check the session
type we settled on later to condition out the OSC sequence (because it
should only be issued on TTY sessions). However, the session type string
originally quite likely points into the PAM environment block, which we
update in the meantime, invalidating that pointer. hence, make an
explicit copy first, and use that.

8 months agorun: generate OSC context sequence in run0/system-run
Lennart Poettering [Mon, 18 Nov 2024 11:46:50 +0000 (12:46 +0100)] 
run: generate OSC context sequence in run0/system-run