Commit Graph
87961 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2d2b4cc009 shared/facts: use SD_JSON_BUILD_PAIR_VARIANT in one more place
Suggested in review by Claude.
2026-04-16 17:21:56 +02:00
Zbigniew Jędrzejewski-Szmek 93ee4308d9 journal-upload: require TLS 1.2 as the minimum version
RFC 8996 says:
> This document formally deprecates Transport Layer Security (TLS)
> versions 1.0 (RFC 2246) and 1.1 (RFC 4346). Accordingly, those
> documents have been moved to Historic status. These versions lack
> support for current and recommended cryptographic algorithms and
> mechanisms, and various government and industry profiles of
> applications using TLS now mandate avoiding these old TLS versions.
> TLS version 1.2 became the recommended version for IETF protocols in
> 2008 (subsequently being obsoleted by TLS version 1.3 in 2018),
> providing sufficient time to transition away from older versions.
> Removing support for older versions from implementations reduces the
> attack surface, reduces opportunity for misconfiguration, and
> streamlines library and product maintenance.

This code probably only talks to our own receiver which uses
libmicrohttpd. That in turn delegates to GnuTLS, which supports
1.2, 1.3, 3.0, etc.
2026-04-16 17:21:56 +02:00
Zbigniew Jędrzejewski-Szmek b63373a656 meson: use a convenience lib for curl-util.c
Previously we compiled curl-util.c at least two times, and then also
shared it using the extract+object. Let's build a static "convenience lib"
for it.

(Using extract+object everywhere is not possible because the different
places where it is used are conditionalized independently so we don't
have a single "source" that is always available.)
2026-04-16 17:21:56 +02:00
Zbigniew Jędrzejewski-Szmek cdc8aadaed shared: move src/import/curl-util.h to src/shared/
Move more common definitions in the header file instead of repeating
them in bunch of places. src/import/curl-util.[ch] is renamed so that
it's shared more naturally with other components.
2026-04-15 21:27:39 +02:00
Zbigniew Jędrzejewski-Szmek 0ba59c3d32 journal-upload: modernize macro wrapping curl_easy_setopt
We cannot use a function, because the type is unknown and we want
to stringify the option name, but we can use a block macro to make
this a bit nicer, with normal code structure in the caller.
2026-04-15 00:40:59 +02:00
Zbigniew Jędrzejewski-Szmek 4347c3bcce report: use the new option and verb macros 2026-04-15 00:35:56 +02:00
Daan De Meyer 0d57260976 TEST-75-RESOLVED: Make sure --suppress-sync is not used 2026-04-14 20:35:24 +02:00
Daan De Meyer 31441cb782 test-seccomp: Handle environment where sync() is already suppressed
We might be running in an nspawn container booted with --suppress-sync,
so make sure we handle that scenario gracefully.
2026-04-14 20:35:24 +02:00
Daan De Meyer 72cfcfa0ec TEST-06-SELINUX: Relabel in the initrd rather than at image build time
This gets rid of the requirement to run the image build as root.
2026-04-14 20:35:24 +02:00
Daan De Meyer 014a4d93e0 TEST-64-UDEV-STORAGE: Add missing scsi controllers 2026-04-14 20:35:24 +02:00
Daan De Meyer a8416614b0 TEST-24-CRYPTSETUP: Use virtio-blk-pci
Doesn't require a controller.
2026-04-14 20:35:24 +02:00
Daan De Meyer 518dcfadab TEST-13-NSPAWN: Use timeout --foreground in two more places 2026-04-14 20:35:24 +02:00
Daan De Meyer 9c0abfaf15 TEST-07-PID1: Use --foreground with timeout
Otherwise the test fails if a TTY is attached to stdio.
2026-04-14 20:35:24 +02:00
Daan De Meyer e7d1030d77 TEST-07-PID1: Don't fail in vm without ESP or XBOOTLDR mount 2026-04-14 20:35:24 +02:00
roib db1ca20591 docs: update footer to 2026 2026-04-14 17:32:37 +01:00
Nick Rosbrook da18a5cfd6 test: do not use nanoseconds width specifier in date command
Using the format specifier +%s%6N with GNU date is honored, and only
prints 6 digits of the nanoseconds portion of the seconds since epoch.
The uutils implementation of date does not honor this, and always prints
all 9 digits. This is a known bug[1], but can be worked around by
adapting this test to use nanoseconds instead of microseconds.

[1] https://github.com/uutils/coreutils/issues/11658
2026-04-14 14:54:32 +01:00
Daan De Meyer 78ab4d1f7d parse-helpers: Silence coverity warning 2026-04-14 15:51:02 +02:00
Lennart Poettering 03ee08d1d7 tree-wide: convert remaining varlink string fields to enum types (#41615)
Follow-up to #40972. Convert remaining plain string fields to proper
varlink enum types across all interfaces, per the policy that
user-controlled/API fields should be declared as proper enums in the
IDL.

Interfaces converted:
- io.systemd.Manager — LogTarget, DefaultStandardOutput/Error,
DefaultMemory/CPU/IOPressureWatch, DefaultOOMPolicy,
CtrlAltDelBurstAction (8 fields)
- io.systemd.Unit — CPUSchedulingPolicy, IOSchedulingClass, NUMAPolicy,
MountFlags (4 fields)
- io.systemd.Machine — class, whom (2 fields, input dispatch converted
to JSON_DISPATCH_ENUM_DEFINE for automatic dashify fallback)
- io.systemd.oom / io.systemd.ManagedOOM — mode in ControlGroup (1
field)

Shared types moved to varlink-idl-common: ExecOutputType,
CGroupPressureWatch, EmergencyAction, ManagedOOMMode — these are reused
across multiple interfaces.

Each interface change includes a corresponding enum sync test to catch
future drift between C string tables and varlink IDL definitions.
2026-04-14 14:04:13 +02:00
Lennart Poettering 1b53324959 tree-wide: use JSON_BUILD_PAIR_ENUM() more often 2026-04-14 13:58:36 +02:00
Ivan Kruglov 3dd09ccea2 docs: clarify when to use varlink enum types vs plain strings
Add guidance on when a field should use a proper varlink enum type
versus remaining a plain string: user-controlled/API fields should be
enums, engine-internal state fields may stay as strings.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 13:37:02 +02:00
Ivan Kruglov 6518bcf872 varlink: add ManagedOOMMode enum type to io.systemd.oom
Convert the mode field in ControlGroup from plain string to the
ManagedOOMMode enum type from varlink-idl-common. Register
ManagedOOMMode in both io.systemd.oom and io.systemd.ManagedOOM
interfaces since both use the ControlGroup struct.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 02:10:52 -07:00
Ivan Kruglov 5d0ac2c23c varlink: add enum types for class and whom fields in io.systemd.Machine
Convert the class field (Register input, List output) from plain string
to MachineClass enum type, and the whom field (Kill input) to KillWhom
enum type.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 02:10:52 -07:00
Ivan Kruglov 2fda0fb4c7 varlink: add enum types for scheduling and mount settings in io.systemd.Unit
Convert CPUSchedulingPolicy, IOSchedulingClass, NUMAPolicy and MountFlags
fields from plain strings to proper varlink enum types in the io.systemd.Unit
interface. Update the corresponding serialization code to use
json_underscorify() for correct enum value formatting.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 02:10:52 -07:00
Ivan Kruglov b5aa7635ce varlink: add enum types for configuration settings in io.systemd.Manager
Convert 8 string fields in the io.systemd.Manager varlink interface to
proper enum types:

- LogTarget: new enum (console, console_prefixed, kmsg, journal, ...)
- DefaultStandardOutput/Error: reuse ExecOutputType from common
- DefaultMemory/CPU/IOPressureWatch: reuse CGroupPressureWatch from common
- DefaultOOMPolicy: new enum (continue, stop, kill)
- CtrlAltDelBurstAction: reuse EmergencyAction from common

Output serialization updated to use JSON_BUILD_PAIR_ENUM for automatic
underscorification of dash-containing values.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 02:10:52 -07:00
Luca Boccassi 275ec1160b importd: harden curl file protocol handling
With old libcurl versions file:// can get redirects which can be messy, while
the new version rejects them. Set an option to explicit block them.
2026-04-14 10:45:38 +02:00
Zbigniew Jędrzejewski-Szmek c5b4aeefcb Assorted cleanups and fixes (#41626) 2026-04-14 09:10:16 +02:00
Christian Brauner 1006f6ca4c NEWS: pre-announce removal of /run/boot-loader-entries/ support in lo… (#41622)
…gind

logind could read UAPI.1 Boot Loader Spec entries from
/run/boot-loader-entries/ in addition to ESP/XBOOTLDR. This was pretty
half-assed, and to my knowledge was never actually used much.

Let's remove support for it and simplify our codebase.

Let's schedule it for removal via NEWS in a future version, to give
people a chance to speak up.
2026-04-14 08:54:33 +02:00
Sriman Achanta 765416cae6 hwdb: Add extended SteelSeries Arctis headset device support (#41628)
Add USB device IDs for additional SteelSeries Arctis headset models to
the sound card hardware database.

Newly added device IDs:

- Arctis Nova 7x v2 (22AD)
- Arctis Nova 7 Diablo IV (22A9)
- Arctis Nova 7X (22A4)
- Arctis Nova 7X (22A5)
- Arctis Nova 7P V2 (22A7)
2026-04-14 01:08:30 +01:00
Luca Boccassi f125fc6a22 journal-upload: also disable VERIFYHOST when --trust=all is used
When --trust=all disables CURLOPT_SSL_VERIFYPEER, the residual
CURLOPT_SSL_VERIFYHOST check is ineffective since an attacker can
present a self-signed certificate with the expected hostname. Disable
both for consistency and log that server certificate verification is
disabled.

Follow-up for 8847551bcb
2026-04-13 22:11:50 +01:00
Luca Boccassi a9e9288288 machined: pass user as positional argument in machine_default_shell_args()
Instead of interpolating the user name directly into the sh -c script
body via asprintf %s, pass it as a positional parameter ($1) in a
separate argv entry. This avoids the user string being parsed as part
of the shell script syntax.

Also validate the user name in bus_machine_method_open_shell() with
valid_user_group_name(), matching the validation already done on the
Varlink path via json_dispatch_const_user_group_name().

Follow-up for 49af9e1368
2026-04-13 22:11:50 +01:00
Luca Boccassi 4bf9db7314 logind: reject wall messages containing control characters
method_set_wall_message() and the property setter only checked the
message length but not its content. Since wall messages are broadcast
to all TTYs, control characters in the message could interfere with
terminal state. Reject messages containing control characters other
than newline and tab.

Follow-up for 9ef15026c0
Follow-up for e2fa5721c3
2026-04-13 22:11:50 +01:00
Luca Boccassi 04f32dddd7 core: check selinux access on each unit when listing
Units might have different access rules, so check the access on each
unit when querying the full list.
2026-04-13 22:11:50 +01:00
Luca Boccassi 26fd286210 core: add missing SELinux access checks when listing units
Add mac_selinux_unit_access_check_varlink() to the unit enumeration
loop in vl_method_list_units(), silently skipping units the caller
is not permitted to see, matching the D-Bus ListUnits behavior.
Add mac_selinux_access_check_varlink() to vl_method_describe_manager().

Follow-up for 472abf7bec
Follow-up for 736349958e
2026-04-13 22:11:43 +01:00
Christian Brauner 73cbf95d25 vmspawn: Support RUNTIME_DIRECTORY again (#41619)
In ccecae0efd ("vmspawn: use machine name in runtime directory path")
support for RUNTIME_DIRECTORY was dropped which makes it difficult to
run systemd-vmspawn in a service unit which doesn't have write access to
the regular /run but should use its own managed RUNTIME_DIRECTORY. What
worked before was --keep-unit --system but we can't use XDG_RUNTIME_DIR
and --user because then --keep-unit breaks which we need because it
can't create a scope as there is no session. Switch back to
runtime_directory which handles RUNTIME_DIRECTORY and tells us whether
we should use it as is without later cleanup or if we need to use the
regular path where we create and delete the directory ourselves.
2026-04-13 19:46:55 +02:00
Lennart Poettering 1716467bfa NEWS: pre-announce removal of /run/boot-loader-entries/ support in logind
logind could read UAPI.1 Boot Loader Spec entries from
/run/boot-loader-entries/ in addition to ESP/XBOOTLDR. This was pretty
half-assed, and to my knowledge was never actually used much.

Let's remove support for it and simplify our codebase.

Let's schedule it for removal via NEWS in a future version, to give
people a chance to speak up.
2026-04-13 17:53:12 +02:00
rusty-snake b40ed2067f docs: fix capability name, it's CAP_MKNOD not CAP_SYS_MKNOD (#41621) 2026-04-13 16:41:33 +01:00
Daan De Meyer 8383d033cc ci: Two claude-review fixes
- Use persist-credentials: false for actions/checkout, so we don't
  leak the github token credentials to subsequent jobs.
- Remove one / from the Edit/Write permissions. Currently, with the
  absolute path from github.workspace, we expand to three slashes while
  we only need two.
2026-04-13 16:30:15 +01:00
Ivan Kruglov 29c00e0295 varlink: move shared enum types to varlink-idl-common
Move ExecOutputType, CGroupPressureWatch, EmergencyAction and
ManagedOOMMode enum type definitions from varlink-io.systemd.Unit to
varlink-idl-common, as these types are shared across multiple varlink
interfaces.

Co-developed-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-13 05:37:08 -07:00
Kai Lüke 47237cf623 vmspawn: Support RUNTIME_DIRECTORY again
In ccecae0efd ("vmspawn: use machine name in runtime directory path")
support for RUNTIME_DIRECTORY was dropped which makes it difficult to
run systemd-vmspawn in a service unit which doesn't have write access
to the regular /run but should use its own managed RUNTIME_DIRECTORY.
What worked before was --keep-unit --system but we can't use
XDG_RUNTIME_DIR and --user because then --keep-unit breaks which
we need because it can't create a scope as there is no session.
Switch back to runtime_directory which handles RUNTIME_DIRECTORY and
tells us whether we should use it as is without later cleanup or if we
need to use the regular path where we create and delete the directory
ourselves.
2026-04-13 21:33:15 +09:00
Zbigniew Jędrzejewski-Szmek 1726224b07 many: final final set of coccinelle check-pointer-deref tweaks (#41595)
I promised in https://github.com/systemd/systemd/pull/41426 that its the
final update for coccinelle pointer deref checks. However it turned out
there is this coccinelle/parsing_hacks.h that I wasn't aware of. The
file missed some important things like _cleanup_(x) that prevented
coccinelle to check a bunch of functions.

This PR adds some missing defines to the parsing_hacks.h and fixes the
missing asserts(). I apologize that its a bit long (and frankly boring)
and that I missed this earlier.

The last commit contains one small behavior change (ret in
sd_varlink_idl_parse() is now really optional) but the big one is very
mechanical.
2026-04-13 13:59:24 +02:00
Lennart Poettering 4fdc4af7f6 stat-util: use stat_verify_xyz() and friends more (#41613) 2026-04-13 13:39:47 +02:00
Arnout Engelen 086707ba79 run: allow setting output format
This is useful when moving from `--pty` or `--pipe` to using
`--verbose`: you can use `--verbose-output=cat` to get similar output on
stdout while still having all of the advantages of `--verbose` over the
other options.
2026-04-13 13:38:04 +02:00
Lennart Poettering 7977c14273 stat-util: always check S_ISDIR() before S_ISLNK()
Check S_ISDIR() before S_ISLINK() for all stat_verify_xyz() helpers
first, where we check them. Just to ensure we systematically return the
same errors.
2026-04-13 13:20:43 +02:00
Lennart Poettering aa0da09127 stat-util: also add stat_verify_char() and use it everywhere 2026-04-13 13:20:43 +02:00
Lennart Poettering 4eb60e3160 socket-netlink: use stat_verify_socket() more 2026-04-13 13:20:43 +02:00
Lennart Poettering 4031a73a4b tree-wide: use stat_verify_directory() more 2026-04-13 13:20:43 +02:00
Lennart Poettering 8e0756c0b5 tree-wide: use stat_verify_regular() more 2026-04-13 13:20:43 +02:00
Lennart Poettering bda7e91337 stat-util: also introduce stat_verify_block() and use it everywhere 2026-04-13 13:20:43 +02:00
Lennart Poettering 7f2410deb1 stat-util: add shortcut for fd_verify_symlink()
We have a similar shortcut in the other fd_verify_xyz() calls, let's add
it here too, just for completion's sake.
2026-04-13 13:20:43 +02:00
Lennart Poettering 596c0a259d tree-wide: make more use of stat_verify_device_node() 2026-04-13 13:20:43 +02:00