]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
10 months agoptyfwd: fix logic of OSC sequence termination 35640/head
Yu Watanabe [Mon, 16 Dec 2024 07:25:00 +0000 (16:25 +0900)] 
ptyfwd: fix logic of OSC sequence termination

Previously, when an OSC sequence is terminated with \x1b\x5c, configured
OSC sequence would be inserted between the two characters, rather
than after the two.

Fixes a bug introduced by d848a9499830c530e804a41ffd8aa1bc942fa735.
Fixes #35631.

10 months agoptyfwd: clean up logic of color state transition in pty_forward_ansi_process()
Yu Watanabe [Mon, 16 Dec 2024 07:23:49 +0000 (16:23 +0900)] 
ptyfwd: clean up logic of color state transition in pty_forward_ansi_process()

Drop all 'continue', to make the logic easy to understand.
No functional change, just refactoring and preparation for later commit.

10 months agohwdb: Make remote controllable lights work out-of-the-box
Bastien Nocera [Thu, 12 Dec 2024 13:23:46 +0000 (14:23 +0100)] 
hwdb: Make remote controllable lights work out-of-the-box

Give access to USB/Bluetooth lights such as the Logitech Litra family of
devices.

The Logitech devices in particular are accessible through USB
and Bluetooth.

10 months agotest/README: Environment= setting for mkosi should be in [Build] section
Yu Watanabe [Sun, 15 Dec 2024 17:02:30 +0000 (02:02 +0900)] 
test/README: Environment= setting for mkosi should be in [Build] section

Otherwise, we get the following warning:

mkosi.local.conf: Setting Environment should be configured in [Build], not [Content].

10 months agohwdb: add scancodes for HP Elitebook 2170p runnning coreboot
persmule [Sun, 15 Dec 2024 13:03:57 +0000 (21:03 +0800)] 
hwdb: add scancodes for HP Elitebook 2170p runnning coreboot

HP Elitebook 2170p's keyboard scancodes under coreboot is different
with those under oem firmware. The scan code of backspace key of HP
Elitebook 2170p under coreboot is 0x66, but 93b078c has
KEYBOARD_KEY_66=pickup_phone for general HP laptops, making the
backspace key of the HP Elitebook 2170p running coreboot unusable.

The committed scancodes map KEYBOARD_KEY_66 back to backspace, and
provide all Fn-keys of HP Elitebook 2170p under coreboot.
Their evdev string matches the default SMBIOS tables of coreboot
for Elitebook 2170p, to avoid conflict with HP Elitebook 2170p running
oem firmware.

Fixes #35469 and https://ticket.coreboot.org/issues/571

10 months agoTEST-35-LOGIN: check only tty session
Yu Watanabe [Sun, 15 Dec 2024 08:42:10 +0000 (17:42 +0900)] 
TEST-35-LOGIN: check only tty session

For some reasons, another session logind-test-user may be started.
===
Dec 13 07:04:16 systemd-logind[2140]: Got message type=method_call ... member=CreateSessionWithPIDFD ...
(snip)
Dec 13 07:04:16 systemd-logind[2140]: New session 15 of user logind-test-user.
Dec 13 07:04:16 systemd-logind[2140]: VT changed to 2
Dec 13 07:04:16 systemd-logind[2140]: rfkill: Found udev node /dev/rfkill for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: udmabuf: Found udev node /dev/udmabuf for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Found static node /dev/snd/timer for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Found static node /dev/snd/seq for seat seat0
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/snd/timer for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/rfkill for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/udmabuf for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd-logind[2140]: Changing ACLs at /dev/snd/seq for seat seat0 (uid 0→4712 add)
Dec 13 07:04:16 systemd[1]: user-4712.slice: Changed dead -> active
Dec 13 07:04:16 systemd[1]: user-4712.slice: Job 5951 user-4712.slice/start finished, result=done
Dec 13 07:04:16 systemd[1]: Created slice user-4712.slice.
Dec 13 07:04:16 systemd-logind[2140]: Electing new display for user logind-test-user
Dec 13 07:04:16 systemd-logind[2140]: Choosing session 15 in preference to -
(snip)
Dec 13 07:04:16 systemd-logind[2140]: Got message type=method_call ... member=CreateSessionWithPIDFD ...
(snip)
Dec 13 07:04:16 systemd-logind[2140]: New session 16 of user logind-test-user.
Dec 13 07:04:16 systemd-logind[2140]: Electing new display for user logind-test-user
Dec 13 07:04:16 systemd-logind[2140]: Ignoring session 16
===
Let's track only session for the user with tty, which we explicitly created.

Fixes #35597.

10 months agonetwork: don't warn with no NSID assigned
Ronan Pigott [Sat, 14 Dec 2024 21:39:26 +0000 (14:39 -0700)] 
network: don't warn with no NSID assigned

This is nothing interesting to warn about. Also use the symbolic
constant name when testing for this condition.

10 months agotest: include MAINPID in notify message in TEST-50-DISSECT for notify socket
Luca Boccassi [Sat, 14 Dec 2024 16:44:40 +0000 (16:44 +0000)] 
test: include MAINPID in notify message in TEST-50-DISSECT for notify socket

Copy what systemd-notify does by default by setting it to the PID of the shell,
so that main process tracking works as expected. Also use test -S instead of ls
to check socket.

[   33.980396] (sh)[1024]: run-p1022-i1322.service: Executing: sh -c "echo READY=1 | ncat --unixsock --udp \$NOTIFY_SOCKET --source /run/notify && env"
[   34.138778] systemd[1]: run-p1022-i1322.service: Child 1024 belongs to run-p1022-i1322.service.
[   34.138825] systemd[1]: run-p1022-i1322.service: Main process exited, code=exited, status=0/SUCCESS (success)
[   34.139451] systemd[1]: run-p1022-i1322.service: Failed with result 'protocol'.
[   34.139559] systemd[1]: run-p1022-i1322.service: Service will not restart (restart setting)
[   34.139573] systemd[1]: run-p1022-i1322.service: Changed start -> failed
[   34.139945] systemd[1]: run-p1022-i1322.service: Job 1364 run-p1022-i1322.service/start finished, result=failed

Fixes #35619

Follow-up for 18bb30c3b2ea7f4497edf86414133667b3e155fe

10 months agoudev: move several definitions (#35613)
Luca Boccassi [Sat, 14 Dec 2024 16:32:02 +0000 (16:32 +0000)] 
udev: move several definitions (#35613)

10 months agotest-time-util: fix truncation of usec to sec
Yu Watanabe [Sat, 14 Dec 2024 07:49:54 +0000 (16:49 +0900)] 
test-time-util: fix truncation of usec to sec

Also
- use ASSERT_XYZ() macros,
- log tzname[] on failure.

10 months agomkosi: fix section for WithNetwork=
Luca Boccassi [Sat, 14 Dec 2024 10:57:34 +0000 (10:57 +0000)] 
mkosi: fix section for WithNetwork=

/tmp/autopkgtest.L6NPL0/build.doZ/src/mkosi.conf.d/10-debian-ubuntu/mkosi.conf.d/network.conf: Setting WithNetwork should be configured in [Build], not [Content]

10 months agoTEST-07-PID1: fixlets for running with sanitizers (#35616)
Luca Boccassi [Sat, 14 Dec 2024 12:21:45 +0000 (12:21 +0000)] 
TEST-07-PID1: fixlets for running with sanitizers (#35616)

Hopefully fixes #35546.

10 months agoTEST-07-PID1: skip test cases that invokes unshare when running with sanitizers 35616/head
Yu Watanabe [Sat, 14 Dec 2024 08:34:55 +0000 (17:34 +0900)] 
TEST-07-PID1: skip test cases that invokes unshare when running with sanitizers

Fixes #35546.

10 months agomkosi: drop wrapper for unshare
Yu Watanabe [Sat, 14 Dec 2024 08:29:56 +0000 (17:29 +0900)] 
mkosi: drop wrapper for unshare

This effectively reverts ef9a3241b37690ee0e76d84d48f82135da42e48b,
as it does not work.

10 months agoudev: move enums to udev-def.h 35613/head
Yu Watanabe [Tue, 3 Dec 2024 21:05:38 +0000 (06:05 +0900)] 
udev: move enums to udev-def.h

No functional change, just refactoring and preparation for later
commits.

10 months agoudev: move listen_fds() to udev-manager.c
Yu Watanabe [Tue, 3 Dec 2024 20:02:53 +0000 (05:02 +0900)] 
udev: move listen_fds() to udev-manager.c

Also
- drop redundant error message when manager_init() failed,
- close unexpected fds.

No functional change, just refactoring.

10 months agoudev: several coding style fixes
Yu Watanabe [Wed, 4 Dec 2024 15:44:14 +0000 (00:44 +0900)] 
udev: several coding style fixes

- use 'type* func()' rather than 'type *func()',
- merge variable declarations,
- etc.

10 months agoudev: several trivial cleanups for builtins (#35612)
Daan De Meyer [Sat, 14 Dec 2024 06:48:50 +0000 (06:48 +0000)] 
udev: several trivial cleanups for builtins (#35612)

10 months agotest-udev-spawn: migrate to use ASSERT_XYZ()
Yu Watanabe [Sun, 24 Nov 2024 07:13:04 +0000 (16:13 +0900)] 
test-udev-spawn: migrate to use ASSERT_XYZ()

10 months agoudev-builtin-kmod: log about unloading only when already loaded 35612/head
Yu Watanabe [Tue, 3 Dec 2024 19:55:12 +0000 (04:55 +0900)] 
udev-builtin-kmod: log about unloading only when already loaded

10 months agoudev-builtin: drop unnecessary 'initialized' flag
Yu Watanabe [Tue, 3 Dec 2024 19:52:28 +0000 (04:52 +0900)] 
udev-builtin: drop unnecessary 'initialized' flag

All builtin _init() functions can be called multiple times gracefully,
and _exit() can be called without _init() called.

10 months agoudev-builtin: use FOREACH_ELEMENT() macro
Yu Watanabe [Tue, 3 Dec 2024 19:49:42 +0000 (04:49 +0900)] 
udev-builtin: use FOREACH_ELEMENT() macro

10 months agologind: allow wall messages to be controlled via config file
David Härdeman [Thu, 21 Nov 2024 19:24:06 +0000 (20:24 +0100)] 
logind: allow wall messages to be controlled via config file

Right now, the sending of wall messages on reboot/shutdown/etc can be
controlled via DBus properties. This patch adds support for changing the
default via the logind.conf file as well.

Note that the DBus setting is lost if logind is restarted or reloaded,
but it was already the case before this patch that the setting is lost
upon restart.

10 months agoReplace array with magic indices with normal variables in vconsole-setup (#35181)
Yu Watanabe [Sat, 14 Dec 2024 01:49:01 +0000 (10:49 +0900)] 
Replace array with magic indices with normal variables in vconsole-setup (#35181)

10 months agocore: log disconnect on api and system busses, and dump list of subscribers (#35603)
Yu Watanabe [Sat, 14 Dec 2024 01:20:35 +0000 (10:20 +0900)] 
core: log disconnect on api and system busses, and dump list of subscribers (#35603)

Split out of #35406.

10 months agolog: raise log level to LOG_DEBUG if $DEBUG_INVOCATION=1 is set (#35606)
Yu Watanabe [Sat, 14 Dec 2024 01:16:53 +0000 (10:16 +0900)] 
log: raise log level to LOG_DEBUG if $DEBUG_INVOCATION=1 is set (#35606)

Let's implement our own protocols, and raise the log level to debug if
DEBUG_INVOCATION=1 is set.

Follow-up for: 7d8bbfbe0852ec89590d1dc5e28afc95d6d44fa1

10 months agonetwork: add MPLSRouting= setting to enable MPLS routing (#35495)
Yu Watanabe [Sat, 14 Dec 2024 00:35:19 +0000 (09:35 +0900)] 
network: add MPLSRouting= setting to enable MPLS routing (#35495)

Closing #35487.

10 months agosemaphore: bump timeout (#35610)
Luca Boccassi [Sat, 14 Dec 2024 00:21:39 +0000 (00:21 +0000)] 
semaphore: bump timeout (#35610)

When semaphore is overloaded tests can take more than 1hr, bump timeout
and reinstate some removed tests

10 months agoRevert "semaphore: skip some tests" 35610/head
Luca Boccassi [Fri, 13 Dec 2024 23:43:28 +0000 (23:43 +0000)] 
Revert "semaphore: skip some tests"

This reverts commit e19cae12ff2e832ce7d79aa483e1aa27ed0ea1f4.

10 months agosemaphore: bump timeout
Luca Boccassi [Fri, 13 Dec 2024 22:08:27 +0000 (22:08 +0000)] 
semaphore: bump timeout

When semaphore is overloaded tests can take more than 1hr, bump
timeout

10 months agoupdate TODO 35606/head
Lennart Poettering [Fri, 13 Dec 2024 19:00:41 +0000 (20:00 +0100)] 
update TODO

10 months agolog: raise log level to LOG_DEBUG if $DEBUG_INVOCATION=1 is set
Lennart Poettering [Fri, 13 Dec 2024 18:52:53 +0000 (19:52 +0100)] 
log: raise log level to LOG_DEBUG if $DEBUG_INVOCATION=1 is set

Let's implement our own protocols, and raise the log level to debug if
DEBUG_INVOCATION=1 is set.

Follow-up for: 7d8bbfbe0852ec89590d1dc5e28afc95d6d44fa1

10 months agovconsole-setup: drop impossible condition 35181/head
Zbigniew Jędrzejewski-Szmek [Wed, 13 Nov 2024 12:19:39 +0000 (13:19 +0100)] 
vconsole-setup: drop impossible condition

10 months agovconsole-setup: use normal variables instead of an array
Zbigniew Jędrzejewski-Szmek [Wed, 13 Nov 2024 12:10:57 +0000 (13:10 +0100)] 
vconsole-setup: use normal variables instead of an array

We had this elaborate scheme with an array of strings instead of a bunch of a
normal string fields. If there were hundreds of those strings, this would make
sense. But we had just five and one was actually a bit different because it had
a fallback, so overall, the code is easier to read when normal fields are used.

The fallback was implemented in the accessor function, now it's actually
implemented in the place where it's used.

While at it, rename the variables so that they match the config keys for
legibility.

10 months agotmpfiles: reduce quoting in warning message
Zbigniew Jędrzejewski-Szmek [Thu, 7 Nov 2024 14:45:24 +0000 (15:45 +0100)] 
tmpfiles: reduce quoting in warning message

We printed:
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/20-systemd-shell-extra.conf:10: Unknown modifiers in command 'L$'.
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/systemd-network.conf:10: Unknown modifiers in command 'd$'.
systemd-tmpfiles[705]: /usr/lib/tmpfiles.d/systemd-network.conf:11: Unknown modifiers in command 'd$'.
...

There's a lot of additional characters here make the message harder to parse. We know
that the command is a word without any whitespace, so quoting isn't really necessary.

Change this to:
... unknown modifiers in command: L$

10 months agotest-network: add test case for MPLSRouting=yes 35495/head
Yu Watanabe [Fri, 6 Dec 2024 20:47:07 +0000 (05:47 +0900)] 
test-network: add test case for MPLSRouting=yes

10 months agonetwork: introduce MPLSRouting= to enable MPLS routing
Yu Watanabe [Fri, 6 Dec 2024 20:46:13 +0000 (05:46 +0900)] 
network: introduce MPLSRouting= to enable MPLS routing

Closing #35487.

10 months agosysctl-util: support AF_MPLS
Yu Watanabe [Fri, 6 Dec 2024 20:03:56 +0000 (05:03 +0900)] 
sysctl-util: support AF_MPLS

To support writing/reading e.g. /proc/sys/net/mpls/conf/eth0/input .

10 months agorepart: Take configured minimum and maximum size into account for Minimize=
Daan De Meyer [Sat, 23 Nov 2024 10:36:54 +0000 (11:36 +0100)] 
repart: Take configured minimum and maximum size into account for Minimize=

- Let's check if the minimum size we got is larger than the configured
maximum partition size and fail early if it is.
- Let's make sure for writable filesystems that we make the minimal
filesystem at least as large as the minimum partition size, to allow
creating minimal filesystems with a minimum size.

10 months agoRevert "repart: Drop unprivileged subvolumes logic for btrfs"
Daan De Meyer [Wed, 18 Sep 2024 14:42:12 +0000 (16:42 +0200)] 
Revert "repart: Drop unprivileged subvolumes logic for btrfs"

This adds back support for unprivileged btrfs subvolumes which
can be merged once btrfs-progs 6.12 is out.

This reverts commit 4d9ccdc9aec5728a6bfc66879420b2af25817e03.

10 months agocore: Bind mount notify socket to /run/host/notify in sandboxed units (#35573)
Daan De Meyer [Fri, 13 Dec 2024 13:48:07 +0000 (13:48 +0000)] 
core: Bind mount notify socket to /run/host/notify in sandboxed units (#35573)

To be able to run systemd in a Type=notify transient unit, the notify
socket can't be bind mounted to /run/systemd/notify as systemd in the
transient unit wants to use that as its own notify socket which
conflicts with systemd on the host.

Instead, for sandboxed units, let's bind mount the notify socket to
/run/host/notify as documented in the container interface. Since we
don't guarantee a stable location for the notify socket and insist users
use $NOTIFY_SOCKET to get its path, this is safe to do.

10 months agojournalctl: make --setup-keys honor --output=json and --quiet (#35507)
Luca Boccassi [Fri, 13 Dec 2024 13:40:09 +0000 (13:40 +0000)] 
journalctl: make --setup-keys honor --output=json and --quiet (#35507)

Closes #35503.
Closes #35504.

10 months agocore: Bind mount notify socket to /run/host/notify in sandboxed units 35573/head
Daan De Meyer [Wed, 11 Dec 2024 18:45:28 +0000 (18:45 +0000)] 
core: Bind mount notify socket to /run/host/notify in sandboxed units

To be able to run systemd in a Type=notify transient unit, the notify
socket can't be bind mounted to /run/systemd/notify as systemd in the
transient unit wants to use that as its own notify socket which conflicts
with systemd on the host.

Instead, for sandboxed units, let's bind mount the notify socket to
/run/host/notify as documented in the container interface. Since we don't
guarantee a stable location for the notify socket and insist users use
$NOTIFY_SOCKET to get its path, this is safe to do.

10 months agocore/namespace: several fixes for recently merged PRs (#35580)
Daan De Meyer [Fri, 13 Dec 2024 12:34:11 +0000 (12:34 +0000)] 
core/namespace: several fixes for recently merged PRs (#35580)

Fixes #35546.
Fixes #35566.

10 months agohwdb: move down touchpad toggle section from generic to product specific
Soumyadeep Ghosh [Thu, 12 Dec 2024 13:20:33 +0000 (18:50 +0530)] 
hwdb: move down touchpad toggle section from generic to product specific

adding `KEYBOARD_KEY_76` in generic section is causing a regression
in MSI GF63. Moving this down fixes.
This commit also adds a probable KEY Code for MSI GF63 touchpad toggling

10 months agocore: Add PrivateUsers=full (#35183)
Luca Boccassi [Fri, 13 Dec 2024 12:25:13 +0000 (12:25 +0000)] 
core: Add PrivateUsers=full (#35183)

Recently, PrivateUsers=identity was added to support mapping the first
65536 UIDs/GIDs from parent to the child namespace and mapping the other
UID/GIDs to the nobody user.

However, there are use cases where users have UIDs/GIDs > 65536 and need
to do a similar identity mapping. Moreover, in some of those cases,
users want a full identity mapping from 0 -> UID_MAX.

To support this, we add PrivateUsers=full that does identity mapping for
all available UID/GIDs.

Note to differentiate ourselves from the init user namespace, we need to
set up the uid_map/gid_map like:
```
0 0 1
1 1 UINT32_MAX - 1
```

as the init user namedspace uses `0 0 UINT32_MAX` and some applications
- like systemd itself - determine if its a non-init user namespace based
on uid_map/gid_map files.

Note systemd will remove this heuristic in running_in_userns() in
version 258 (https://github.com/systemd/systemd/pull/35382) and uses
namespace inode. But some users may be running a container image with
older systemd < 258 so we keep this hack until version 259 for version
N-1 compatibility.

In addition to mapping the whole UID/GID space, we also set
/proc/pid/setgroups to "allow". While we usually set "deny" to avoid
security issues with dropping supplementary groups
(https://lwn.net/Articles/626665/), this ends up breaking dbus-broker
when running /sbin/init in full OS containers.

Fixes: #35168
Fixes: #35425
10 months agologind: let system-wide idle begin at the time logind was initialized
Florian Schmaus [Sat, 16 Nov 2024 09:29:35 +0000 (10:29 +0100)] 
logind: let system-wide idle begin at the time logind was initialized

Initialize the start of the system-wide idle time with the time logind was
initialized and not with the start of the Unix epoch. This means that systemd
will not repport a unreasonable long idle time (around 54 years at the time of
writing this), especially at in the early boot, while no login manager session,
e.g,. gdm, had a chance to provide a more accurate start of the idle period.

Fixes #35163

10 months agoCouple small cleanups (#35593)
Mike Yuan [Fri, 13 Dec 2024 12:01:27 +0000 (13:01 +0100)] 
Couple small cleanups (#35593)

10 months agobasic/fileio: two modernizations (#35559)
Daan De Meyer [Fri, 13 Dec 2024 11:49:12 +0000 (11:49 +0000)] 
basic/fileio: two modernizations (#35559)

10 months agoshell-completion: add smbios11 verb to systemd-analyze
Luca Boccassi [Thu, 12 Dec 2024 12:41:45 +0000 (12:41 +0000)] 
shell-completion: add smbios11 verb to systemd-analyze

Follow-up for 8c5045f9b2681774e8731dc0d142c207b61aedf6

10 months agomkosi: update debian commit reference
Luca Boccassi [Thu, 12 Dec 2024 16:46:11 +0000 (16:46 +0000)] 
mkosi: update debian commit reference

e8b7c9a4dd Install 81-net-bridge.rules
50d2997a07 Install systemd-creds bash completion
ff0c42823c test: fix flaky boot-and-services test
2a19dee4ba test: fix flaky boot-and-services test
a15a0bfe60 Update changelog for 257-2 release
c24eafcb7e Backport patches to fix test failures
29840f9b68 udev: install dmi_memory_id and its rules on riscv64
44893bdb32 Update changelog for 257-1 release
7f71d995fb Update symbols file for v257
2dd2b80499 Update upstream source from tag 'upstream/257'
51a3271a85 Update changelog for 257~rc3-1 release
8e687227c5 Update symbols for 257~rc3
c9bae527d6 Drop patches, merged upstream
e8cf329870 Update upstream source from tag 'upstream/257_rc3'
794457516d autopkgtest: fix one more tzdata dependency
16bb143da1 Bump version in tzdata dependency due to p-u upload
f2ddf70604 sysctl: Add file trigger on /usr/lib/sysctl.d to restart systemd-sysctl
79260cb0f4 Increase minimum sections in stub PE header on arm64/armhf/riscv64 to 500
ed3af24635 systemd-ukfy: recommend systemd-boot-efi for the stub

10 months agocore/mount: don't keep cred mounts around after mounted
Mike Yuan [Thu, 12 Dec 2024 21:03:25 +0000 (22:03 +0100)] 
core/mount: don't keep cred mounts around after mounted

Follow-up for 6577cf1ba96027053cedce97ebb22d4ea96887bd

10 months agotest-loop-block: return -77 on skip in more places 35593/head
Luca Boccassi [Wed, 13 Nov 2024 14:20:34 +0000 (14:20 +0000)] 
test-loop-block: return -77 on skip in more places

10 months agobattery-check: parse options before checking for kernel command line
Luca Boccassi [Fri, 8 Nov 2024 12:23:37 +0000 (12:23 +0000)] 
battery-check: parse options before checking for kernel command line

Otherwise --help/--version/etc which exit immediately will do pointless work

10 months agounits: use PrivateTmp=disconnected instead of 'yes' if DefaultDependencies=no
Luca Boccassi [Thu, 12 Dec 2024 11:48:52 +0000 (11:48 +0000)] 
units: use PrivateTmp=disconnected instead of 'yes' if DefaultDependencies=no

Avoids subtle race conditions such as the one described at
#35582.

Fixes #35582

10 months agocore: fix loading verity settings for MountImages= (#35577)
Luca Boccassi [Thu, 12 Dec 2024 13:06:07 +0000 (13:06 +0000)] 
core: fix loading verity settings for MountImages= (#35577)

The MountEntry logic was refactored to store the verity
settings, and updated for ExtensionImages=, but not for
MountImages=.

Follow-up for a1a40297dbfa5bcd926d1a19320deb73c033c6f5

10 months agonetwork: several cleanups (#35267)
Luca Boccassi [Thu, 12 Dec 2024 12:47:23 +0000 (12:47 +0000)] 
network: several cleanups (#35267)

10 months agomkosi: Fix opensuse build
Daan De Meyer [Thu, 12 Dec 2024 11:58:42 +0000 (11:58 +0000)] 
mkosi: Fix opensuse build

The opensuse spec still looks for README.testsuite so hack it to look
for README.md instead now that we changed the name in the repo.

10 months agocore: Set /proc/pid/setgroups to allow for PrivateUsers=full 35183/head
Ryan Wilson [Sat, 30 Nov 2024 22:14:35 +0000 (14:14 -0800)] 
core: Set /proc/pid/setgroups to allow for PrivateUsers=full

When trying to run dbus-broker in a systemd unit with PrivateUsers=full,
we see dbus-broker fails with EPERM at `util_audit_drop_permissions`.

The root cause is dbus-broker calls the setgroups() system call and this
is disallowed via systemd's implementation of PrivateUsers= by setting
/proc/pid/setgroups = deny. This is done to remediate potential privilege
escalation vulnerabilities in user namespaces where an attacker can remove
supplementary groups and gain access to resources where those groups are
restricted.

However, for OS-like containers, setgroups() is a pretty common API and
disabling it is not feasible. So we allow setgroups() by setting
/proc/pid/setgroups to allow in PrivateUsers=full. Note security conscious
users can still use SystemCallFilter= to disable setgroups() if they want
to specifically prevent this system call.

Fixes: #35425
10 months agogpt-auto: take timeout opts in rootflags= into account; hibernate-resume: always...
Luca Boccassi [Thu, 12 Dec 2024 11:01:40 +0000 (11:01 +0000)] 
gpt-auto: take timeout opts in rootflags= into account; hibernate-resume: always respect user-defined timeout (#35518)

10 months agoExport two more functions, and update symbol tests (#35578)
Luca Boccassi [Thu, 12 Dec 2024 10:39:29 +0000 (10:39 +0000)] 
Export two more functions, and update symbol tests (#35578)

Prompted by #35554.
Continuation of #35555.

10 months agomkosi: wrap unshare command when running with sanitizers 35580/head
Yu Watanabe [Thu, 12 Dec 2024 06:14:32 +0000 (15:14 +0900)] 
mkosi: wrap unshare command when running with sanitizers

Follow-up for 219a6dbbf3ad0121ec43118d4fcdb7b375532cbe.
Fixes #35546.

10 months agocore/namespace: use ProtectHostname in NamespaceParameters
Yu Watanabe [Thu, 12 Dec 2024 04:00:41 +0000 (13:00 +0900)] 
core/namespace: use ProtectHostname in NamespaceParameters

To make the type of NamespaceParameters.protect_hostname consistent
with the one in ExecContext.

Addresses https://github.com/systemd/systemd/pull/35447#discussion_r1880372452.
Fixes #35566.

10 months agocreds: introduce --transcode=help and friends and use them in shell completion (...
Daan De Meyer [Thu, 12 Dec 2024 09:33:44 +0000 (09:33 +0000)] 
creds: introduce --transcode=help and friends and use them in shell completion (#35579)

Follow-ups for 783f794e89996ae7f2ae1872d65c515a672437fa (#35537).

10 months agobash-completion/creds: generate suggestions by systemd-creds itself 35579/head
Yu Watanabe [Thu, 12 Dec 2024 02:51:36 +0000 (11:51 +0900)] 
bash-completion/creds: generate suggestions by systemd-creds itself

Follow-ups for 783f794e89996ae7f2ae1872d65c515a672437fa.

10 months agocreds: support --transcode=help and --with-key=help
Yu Watanabe [Thu, 12 Dec 2024 02:37:36 +0000 (11:37 +0900)] 
creds: support --transcode=help and --with-key=help

10 months agostring-table: make DUMP_STRING_TABLE() returns 0
Yu Watanabe [Thu, 12 Dec 2024 02:31:16 +0000 (11:31 +0900)] 
string-table: make DUMP_STRING_TABLE() returns 0

Then, we can use it as
===
  return DUMP_STRING_TABLE(...);
===

10 months agotpm2-util: allow to control if legend and/or footer shown by tpm2_list_devices()
Yu Watanabe [Thu, 12 Dec 2024 02:01:00 +0000 (11:01 +0900)] 
tpm2-util: allow to control if legend and/or footer shown by tpm2_list_devices()

10 months agoci: enable linter for generate-sym-test.py 35578/head
Yu Watanabe [Thu, 12 Dec 2024 01:27:15 +0000 (10:27 +0900)] 
ci: enable linter for generate-sym-test.py

10 months agotest: also generate list of symbols from header files
Yu Watanabe [Thu, 12 Dec 2024 04:18:59 +0000 (13:18 +0900)] 
test: also generate list of symbols from header files

To make the generated tests able to detect issues like #35554.

10 months agotest: modernize generate-sym-test.py
Yu Watanabe [Thu, 12 Dec 2024 01:01:48 +0000 (10:01 +0900)] 
test: modernize generate-sym-test.py

10 months agosd-json: properly export sd_json_variant_type_from_string() and _to_string()
Yu Watanabe [Thu, 12 Dec 2024 01:09:52 +0000 (10:09 +0900)] 
sd-json: properly export sd_json_variant_type_from_string() and _to_string()

These exist in the header file, but were not exporeted.

Continuation of e11f5aa7226253bf31b2ed61be8599bb213c1819.

10 months agotest: rename README.testsuite -> README.md
Yu Watanabe [Thu, 12 Dec 2024 03:02:19 +0000 (12:02 +0900)] 
test: rename README.testsuite -> README.md

10 months agoREADME: drop CentOS CI badges
Yu Watanabe [Thu, 12 Dec 2024 02:58:24 +0000 (11:58 +0900)] 
README: drop CentOS CI badges

CentOS CIs are disabled after ead814a0b0f64c572282b9e27a0a995893f10cf0.

10 months agopolkit-agent: allow to invoke polkit agent even if STDIN is not a tty (#35431)
Yu Watanabe [Thu, 12 Dec 2024 01:32:02 +0000 (10:32 +0900)] 
polkit-agent: allow to invoke polkit agent even if STDIN is not a tty (#35431)

Closes #35018.

10 months agotest: add more coverage for extensions and verity 35577/head
Luca Boccassi [Thu, 12 Dec 2024 00:50:45 +0000 (00:50 +0000)] 
test: add more coverage for extensions and verity

10 months agocore: fix loading verity settings for MountImages=
Luca Boccassi [Thu, 12 Dec 2024 00:24:05 +0000 (00:24 +0000)] 
core: fix loading verity settings for MountImages=

The MountEntry logic was refactored to store the verity
settings, and updated for ExtensionImages=, but not for
MountImages=.

Follow-up for a1a40297dbfa5bcd926d1a19320deb73c033c6f5

10 months agoshell completion: add systemd-creds
Luca Boccassi [Tue, 10 Dec 2024 22:19:09 +0000 (22:19 +0000)] 
shell completion: add systemd-creds

10 months agosemaphore: skip some tests
Luca Boccassi [Wed, 11 Dec 2024 20:44:25 +0000 (20:44 +0000)] 
semaphore: skip some tests

semaphore CI runs are always very close to the limit of 1hr, and often
time out when it's particularly oversubscribed.
Skip some low-value test cases to shorten the runtime.

10 months agoexec-util: use strv_from_stdarg_alloca() 35431/head
Yu Watanabe [Sun, 1 Dec 2024 08:43:31 +0000 (17:43 +0900)] 
exec-util: use strv_from_stdarg_alloca()

No functional change, just refactoring.

10 months agoexec-util: use open_terminal() in fork_agent() for safety
Yu Watanabe [Tue, 3 Dec 2024 09:58:11 +0000 (18:58 +0900)] 
exec-util: use open_terminal() in fork_agent() for safety

10 months agoexec-util: drop handling of ENXIO in opening /dev/tty
Yu Watanabe [Tue, 3 Dec 2024 09:50:25 +0000 (18:50 +0900)] 
exec-util: drop handling of ENXIO in opening /dev/tty

This effectively reverts 0bcf1679007e71d1d37666c10ab1f8d46de8d570.

The handling is not necessary anymore after 61242b1f0f9cac399deb67c88c3b62d38218dba3.

10 months agoexec-util: split out common checks before fork_agent() to can_fork_agent()
Yu Watanabe [Tue, 3 Dec 2024 09:40:06 +0000 (18:40 +0900)] 
exec-util: split out common checks before fork_agent() to can_fork_agent()

No functional change, just refactoring.

10 months agopolkit-agent: modernize code a bit
Yu Watanabe [Tue, 3 Dec 2024 09:36:15 +0000 (18:36 +0900)] 
polkit-agent: modernize code a bit

- Use _cleanup_close_pair_ attribute for the pipe FDs,
- Return earlier on failure in forking polkit agent.

10 months agoexec-util: allow to invoke polkit/ask-password agent even if STDIN is not a tty
Yu Watanabe [Sun, 1 Dec 2024 08:36:33 +0000 (17:36 +0900)] 
exec-util: allow to invoke polkit/ask-password agent even if STDIN is not a tty

Closes #35018.

10 months agosystemd-cryptenroll.xml: fix typo
Carlo Teubner [Wed, 11 Dec 2024 22:40:07 +0000 (22:40 +0000)] 
systemd-cryptenroll.xml: fix typo

10 months agoformat-table: trivial cleanups (#35572)
Yu Watanabe [Wed, 11 Dec 2024 21:12:07 +0000 (06:12 +0900)] 
format-table: trivial cleanups (#35572)

10 months agoman: update example in systemd-measure.xml (#35506)
cvlc12 [Wed, 11 Dec 2024 21:09:11 +0000 (22:09 +0100)] 
man: update example in systemd-measure.xml (#35506)

In the example from systemd-measure(1), do not bind to PCR 7 in
addition to the PCR policy.

As long as this is still done by default, see #35280.

10 months agoRevert "run: disable --expand-environment by default for --scope"
Mike Yuan [Wed, 10 Jul 2024 19:58:12 +0000 (21:58 +0200)] 
Revert "run: disable --expand-environment by default for --scope"

This reverts commit 8167c56bfa97525a7b12e7c5685576657364e3cf.

We've announced the breaking change during v254-v257. Let's actually
apply it for v258.

10 months agopretty-print: don't use OSC 8 for incompatible URLs (#35223)
Yu Watanabe [Wed, 11 Dec 2024 20:43:36 +0000 (05:43 +0900)] 
pretty-print: don't use OSC 8 for incompatible URLs (#35223)

10 months agocgroup-util: introduce cg_get_cgroupid_at()
Mike Yuan [Fri, 29 Nov 2024 12:43:02 +0000 (13:43 +0100)] 
cgroup-util: introduce cg_get_cgroupid_at()

Suggested in https://github.com/systemd/systemd/pull/35242#discussion_r1862658163

10 months agonsresourced: drop unneeded REMOVE_PHYSICAL flag for rm_rf()
Mike Yuan [Wed, 11 Dec 2024 14:00:03 +0000 (15:00 +0100)] 
nsresourced: drop unneeded REMOVE_PHYSICAL flag for rm_rf()

Even without REMOVE_PHYSICAL, rm_rf() permits cgroupfs.

10 months agoprocess-util: modernize is_main_thread(); make sure get_process_ppid() won't return...
Yu Watanabe [Wed, 11 Dec 2024 20:16:04 +0000 (05:16 +0900)] 
process-util: modernize is_main_thread(); make sure get_process_ppid() won't return ppid == 0 (#35561)

Split out from #35242

10 months agosd-varlink: properly export sd_varlink_reset_fds()
Lennart Poettering [Wed, 11 Dec 2024 12:06:03 +0000 (13:06 +0100)] 
sd-varlink: properly export sd_varlink_reset_fds()

This function was listed in the public sd-varlink.h header, but not
actually made public. Fix that. It's quite useful, the comment in it
describes the usecase nicely.

Fixes: #35554
10 months agolibfido2-util: show also verity features when listing FIDO2 devices (#35295)
Yu Watanabe [Wed, 11 Dec 2024 20:11:46 +0000 (05:11 +0900)] 
libfido2-util: show also verity features when listing FIDO2 devices (#35295)

This way, users don't have to check those features using an external
program, or wait for later failure when trying to enroll using an
unsupported feature.

E.g.:

```
# systemd-cryptenroll --fido2-device list
PATH         MANUFACTURER PRODUCT               RK  CLIENTPIN UP  UV
/dev/hidraw2 Yubico       YubiKey OTP+FIDO+CCID yes no        yes no
```

10 months agoAdd credential support for mount units (#34732)
Yu Watanabe [Wed, 11 Dec 2024 20:07:35 +0000 (05:07 +0900)] 
Add credential support for mount units (#34732)

Add `EXEC_SETUP_CREDENTIALS` flag to allow using credentials with mount units.
Fixes: #23535
10 months agotest-bpf-restrict-fs: Migrate to new assertion macros
Daan De Meyer [Wed, 11 Dec 2024 12:44:26 +0000 (12:44 +0000)] 
test-bpf-restrict-fs: Migrate to new assertion macros

10 months agocondition: add new ConditionKernelModuleLoaded=
Lennart Poettering [Thu, 28 Nov 2024 12:00:34 +0000 (13:00 +0100)] 
condition: add new ConditionKernelModuleLoaded=

This introduces a new unit condition check: that matches if a specific
kmod module is allowed. This should be generally useful, but there's one
usecase in particular: we can optimize modprobe@.service with this and
avoid forking out a bunch of modprobe requests during boot for the same
kmods.

Checking if a kernel module is loaded is more complicated than just
checking if /sys/module/$MODULE/ exists, since kernel modules typically
take a while to initialize and we must check that this is complete (by
checking if the sysfs attr "initstate" is "live").

10 months agojournalctl: also mangle unit name when --invocation= or --list-invocations is specifi...
Yu Watanabe [Wed, 11 Dec 2024 20:01:54 +0000 (05:01 +0900)] 
journalctl: also mangle unit name when --invocation= or --list-invocations is specified (#35542)

Fixes #35538.

10 months agomanager: add list of subscribers to dump info 35603/head
Ronan Pigott [Thu, 28 Nov 2024 19:52:45 +0000 (12:52 -0700)] 
manager: add list of subscribers to dump info

This is handy for debugging.