Commit Graph
91184 Commits
Author SHA1 Message Date
Yu Watanabe b7d2a5ce43 coccinelle: ignore more attributes and macros
This also adds bus_assert_return() as an variant of assertion.

With this change, more code blocks are checked by coccinelle,
thus the test become slightly slower. So the timeout is extended.

Also, as checking exec_invoke() takes so long, let's skip it.
Note, previously the function was skipped due to parse error caused by
unknown cleanup attributes. So, the coverage is not decreased by the
skip.
2026-08-18 06:30:14 +09:00
Yu Watanabe 90481c0b1b tree-wide: add missing assertions
Found by coccinelle.
2026-08-18 06:30:10 +09:00
Yu Watanabe 05f790da8f dhcp: drop unnecessary !!
Found by coccinelle.
2026-08-18 03:33:37 +09:00
Lennart Poettering 31eaee07c3 ask-password-api: move oom check to the right place
Follow-up for: 92e2f70a3c
2026-08-18 02:12:00 +09:00
Zbigniew Jędrzejewski-Szmek ecb4685783 Another batch of conversions to COMMAND and additions of --introspect-cli (#43406) 2026-08-17 16:40:49 +02:00
Zbigniew Jędrzejewski-Szmek fb4a092b9a test: check that systemd-clonesetup's verbs are described by --introspect-cli
Same as for systemd-hwdb and systemd-id128.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 5eb3bf5182 storagetm: make the synopsis more accurate
parse_argv() requires at least one DEVICE unless --all is given, and
refuses DEVICE arguments when --all is given, so "[DEVICE…]" described
neither mode correctly. Spell out the three modes as separate synopsis
lines, like pcrextend and inhibit do, and update the man page to match.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 9cf35bfa4d validatefs: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The positional argument is spelled MOUNTPOINT
in the synopsis, like the other metavars, instead of /path/to/mountpoint,
and the man page synopsis, which said "[DEVICE]", is fixed to match: the
argument is required and it is a mount point.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 760bd23cec update-done: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 3e7b76f672 tpm2-setup: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 9f402dcce5 tpm2-clear: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The man page reference is fixed to
systemd-tpm2-clear.service(8), the only name that page is known by.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 2805c192f9 sysinstall: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The abstract is changed to use the imperative
form ("Install …" instead of "Installs …"), consistent with the other
commands. This also fixes the doubled colon in the "Options::" heading.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek e70f197e37 storagetm: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek de4804f0da systemd-storage-fs: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The abstract is changed from the noun phrase
"Simple file system backed storage provider" to the imperative "Expose
regular files and directories as storage volumes.", following the man
page and consistent with the other commands.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek eb6297012d systemd-storage-block: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The abstract is changed from the noun phrase
"Simple block device backed storage provider" to the imperative "Expose
local block devices as storage volumes.", following the man page and
consistent with the other commands.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 67f17eb4c8 stdio-bridge: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. --help now also references the man page,
which the old help did not.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 3b9dd1ea53 socket-proxyd: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The synopsis no longer marks the target as
optional, since exactly one HOST:PORT or SOCKET argument is required.
The hint about systemd.time(7) is kept as the footer.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek d1c345a079 pcrextend: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The man page is adjusted to match.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 4df2325694 networkd-wait-online: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 9da7b27037 network-generator: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The old help had neither an abstract nor a
man page reference; both are added, with the abstract taken from the
man page.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek c590744048 modules-load: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The abstract is changed to use the imperative
form ("Load …" instead of "Loads …"), consistent with the other
commands.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 7125bf3ac4 journal-upload: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The synopsis now marks the input files as
optional, since the local journal is read when none are given, and
--url= as optional, since URL= may come from journal-upload.conf,
matching the man page.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 9cea0873a0 journal-remote: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The synopsis now marks the input files as
optional, since input may also come from --url=, --getter=, --listen-*=
or passed file descriptors, matching the man page. The note about
sd_listen_fds() is kept as the footer.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 6e64a169bd journal-gatewayd: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The abstract is changed from the noun phrase
"HTTP server for journal events." to the imperative "Serve journal events
over HTTP.", consistent with the other commands, and the meaningless
"..." placeholder is dropped from the synopsis (the tool takes no
positional arguments).
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 031ff861a6 hibernate-resume: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. --clear, which takes no positional
arguments, is listed as a separate synopsis line.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 0e313315bf growfs: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The positional argument is spelled MOUNTPOINT
in the synopsis, like the other metavars, instead of /path/to/mountpoint.
The man page is adjusted to match.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek fca21f54d7 clonesetup: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The two hand-written synopsis lines are
replaced by the generic one, and --help now lists the verbs in a
Commands: section generated from the verb table.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek ec964d79cb boot-check-no-failures: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-17 13:21:31 +02:00
Zbigniew Jędrzejewski-Szmek 494701162f TEST-74-AUX-UTILS.introspect-cli: verify that --help works
This is redundant for public programs, for which we test --help
more extensively, but is also good as a basic check that e.g. the
program name used to print help matches what is specified in COMMAND.
2026-08-17 13:21:17 +02:00
Paul Meyer 8444646969 test: report subtest skips (#43387)
`run_subtests` now handle exit 77 as skip status, making successful
subtests distinguishable from passed tests. Introduce
`run_subtests_and_exit` as a helper to automatically write `/testok` if
all subtests passed, and to write `/skipped` and exit 77 if all subtests
were skipped.
2026-08-17 11:44:56 +02:00
Yu Watanabe c1a72ab778 test: use sd_bus_message_send() 2026-08-17 16:51:53 +09:00
Yu Watanabe 06ef663ac0 main-func: add DEFINE_MAIN_FUNCTION_FIBER (#42238)
Provides a Tokio-like #[tokio::main] entry point for binaries that want
to run their main function inside a fiber on a default sd_event loop.

DEFINE_MAIN_FUNCTION_FIBER(impl) mirrors DEFINE_MAIN_FUNCTION but routes
impl through a new run_main_fiber() helper, which:

  - allocates the default sd_event,
  - enables exit-on-idle so the loop terminates once all event sources
    drain (structured concurrency: impl is expected to cancel and reap
    whatever it spawned before returning),
  - spawns impl as a fiber named after program_invocation_short_name,
  - installs SIGINT/SIGTERM handlers that cancel the main fiber (and
    disable themselves so the loop can go idle once the fiber unwinds),
  - runs sd_event_loop and propagates impl's return value via
    sd_future_result, normalising -ECANCELED to 0 since that just
    represents an orderly signal-driven shutdown.
2026-08-17 04:34:22 +09:00
Yu Watanabe c8e5be587d timesyncd: resolve NTP hostnames through resolved's varlink interface (#43380)
With DNSSEC on, resolved can't validate anything until the clock is
correct,
and without an RTC the only thing that fixes the clock is talking to the
NTP servers we're trying to resolve.

On glibc the timesyncd unit sets SYSTEMD_NSS_RESOLVE_VALIDATE=0 and
nss-resolve turns that into a per-query flag, which breaks the
chicken/egg. musl and systems not using nss-resolve have no NSS, so
nothing
reads it there and we're stuck.

So talk to resolved directly when it's there, and pass
SD_RESOLVED_NO_VALIDATE until we've synced the clock ourselves. Lookups
after that are validated normally, which is better than what we get from
nss. If resolved isn't around we keep using getaddrinfo().

Tested on musl in qemu with the RTC set to 2020 and DNSSEC=yes.
timesyncd syncs when it couldn't before, while `resolvectl query` still
fails with signature-expired, so the "relaxation" is scoped to only
timesyncd.
Once the clock is synced subsequent timesyncd resolver queries no longer
include the flag to disable validation.

fixes #20235
2026-08-17 02:27:17 +09:00
Luca Boccassi b98d348c37 resolved: drop dead assignment
The 'changed' variable is either unused on error or unconditionally
overwritten on success, so coverity warns about it. Drop the unused
assignment.

CID#1685266

Follow-up for a572dd2f60
2026-08-16 22:53:23 +09:00
Pétur c44e9527b7 Fix typos in USER_RECORD.md documentation
Per src/shared/user-record.c
2026-08-16 10:25:33 +01:00
Clayton Craft d52a693164 test: cover both of timesyncd's resolver paths
This checks that we resolve through resolved when it's running, and fall back
to getaddrinfo when it isn't.
2026-08-15 13:12:50 -07:00
Clayton Craft 8027ff6ecd timesyncd: don't ask for AAAA when IPv6 is disabled
ipv6_is_supported only tells us the kernel has IPv6, not that
it's usable. ipv6_is_enabled also checks the sysctl that turns
it off, so we stop resolving addresses we can't use.
2026-08-15 13:12:50 -07:00
Clayton Craft 6279910be7 timesyncd: order after systemd-resolved
Our first resolve happens way before sockets.target, and
systemd-resolved-varlink.socket has no ordering of its own, so there's
nothing making sure the socket is listening by then. Without this the
connect fails and we quietly fall back to getaddrinfo(), which is exactly
the case the varlink path is there for.

Order after both the service and the socket since either one is enough
on its own but neither covers every install situation. For example
resolved binds the socket itself when nothing hands it one, and on
systems where only the socket is enabled the service isn't started at
boot at all.
2026-08-15 13:12:50 -07:00
Clayton Craft 98e7cc36f0 timesyncd: resolve NTP hostnames through resolved's varlink interface
With DNSSEC on, resolved can't validate anything until the clock is
right, and without an RTC the only thing that fixes the clock is talking
to the NTP servers we're trying to resolve. On glibc the timesyncd unit
sets SYSTEMD_NSS_RESOLVE_VALIDATE=0 and nss-resolve turns that into a
per-query flag, which breaks the chicken/egg. musl (and other systems
not using nss-resolve) have no NSS, so nothing reads it there and we're
stuck.

So talk to resolved directly when it's there, and pass
SD_RESOLVED_NO_VALIDATE until we've synced the clock ourselves.
NTP-related lookups after that are validated normally, which is better
than what we get from nss. If resolved isn't around we just keep using
getaddrinfo().

The reply handler duplicates the tail of the getaddrinfo handler, since
the two differ in how they report failures. Varlink discards what the
callback returns, so it has to move on to the next host itself.

This also drops SYSTEMD_NSS_RESOLVE_VALIDATE=0 from the unit because
nss-resolve talks to resolved over the same socket we do, so the
getaddrinfo() path is only ever taken when resolved is unreachable, and
then nothing validates anyway.
2026-08-15 13:12:50 -07:00
Yu Watanabe 65537f059c A batch of conversions to COMMAND struct and additions of --introspect-cli (#43394) 2026-08-16 04:28:05 +09:00
Anton Tiurin 7bd9f0f805 dhcp-server: reject pool offsets beyond the subnet (#43389)
`sd_dhcp_server_configure_pool()` calculated the maximum pool size
before checking whether `PoolOffset=` was inside the subnet.

Because the calculation used unsigned arithmetic, an offset beyond the
broadcast address could wrap around to a large value and pass validation.
For example, `PoolOffset=256` with a `/24` and `PoolSize=1` was accepted,
allowing the DHCP server to offer an address outside its configured subnet.

Reject offsets at or beyond the broadcast address before performing the
subtraction, and calculate the remaining pool size directly as
`broadcast_off - offset`.
2026-08-16 03:35:45 +09:00
dongshengyuan 9711c84c2d resolved: match browsed mDNS services by ifindex
BrowseServices(ifindex=0) may observe the same service on multiple
links. Treat the link index as part of the discovered service
identity so add and remove events remain link-scoped.

Use the per-service ifindex for RFC 6762 maintenance queries.
Share the service identity predicate between add and remove handling,
and propagate RR comparison errors instead of reporting removals.

Extend coverage for scoped-browser ifindex fallback, goodbye TTL
handling, and monotonic expiry updates.
2026-08-16 03:07:32 +09:00
Lefteris T db7fc6cde8 po: Translated using Weblate (Greek)
Currently translated at 93.3% (267 of 286 strings)

Co-authored-by: Lefteris T <lefteris592@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/main/el/
Translation: systemd/main
2026-08-16 03:01:28 +09:00
Zbigniew Jędrzejewski-Szmek caf889d1ea tty-ask-password-agent: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-15 15:30:02 +02:00
Zbigniew Jędrzejewski-Szmek 5c5d3d2065 socket-activate: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The note about sd_listen_fds() is kept as the
footer.
2026-08-15 15:30:02 +02:00
Zbigniew Jędrzejewski-Szmek 440b021cff pty-forward: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-15 15:30:02 +02:00
Zbigniew Jędrzejewski-Szmek a6dfe21862 path: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. --help now goes through the pager, like other
commands with --no-pager.
2026-08-15 15:30:02 +02:00
Zbigniew Jędrzejewski-Szmek 94a955cd31 oomd: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-15 15:30:02 +02:00
Zbigniew Jędrzejewski-Szmek 6fc95be4a2 mute-console: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-15 15:30:02 +02:00
Zbigniew Jędrzejewski-Szmek 548c9cd71c inhibit: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The synopsis now also lists the --list mode,
matching the man page. --help now goes through the pager, like other
commands with --no-pager.
2026-08-15 15:30:02 +02:00