Commit Graph
91248 Commits
Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek ebd9040b30 Fix memleak and double free in varlink methods (#43431) 2026-08-19 10:58:40 +02:00
Yu Watanabe 4430adbd76 sysinstall: refuse multiple requests
Otherwise, that triggers memory leak and double free.
2026-08-19 03:45:14 +09:00
Yu Watanabe 515121f7b3 resolve: refuse multiple requests
Otherwise, that triggers memory leak and double free.
2026-08-19 03:45:11 +09:00
Yu Watanabe b52f89e53b repart: refuse multiple requests with subscribe mode
Otherwise, that triggers memory leak and double free.
2026-08-19 03:29:26 +09:00
Yu Watanabe 112e4fe00a mute-console: refuse multiple requests per connection
Otherwise, that triggers memory leak and multiple free on the same
object.
2026-08-19 03:29:26 +09:00
Yu Watanabe 54253d2a9c journalctl: do not accept multiple requests to get journal entries with following mode
Otherwise, the previously attached FollowState object will be leaked,
and the latest object will be freed multiple times.
2026-08-19 03:29:26 +09:00
Yu Watanabe c2806a8c1d journal: do not accept multiple requests to sync journal per varlink connection
Otherwise, previously allocated SyncReq object will be leaked,
and the latest SyncReq object will be freed multiple times.
2026-08-19 03:29:26 +09:00
Yu Watanabe 0566d7aa35 journal: coding style fix 2026-08-19 03:29:26 +09:00
Yu Watanabe a7ba64356a journal: update comments
The Manager object was renamed from Server.
Maybe we forget to update these comments at that time.
2026-08-19 03:29:17 +09:00
dongshengyuan 3e55065ccf resolvectl: merge JSON error fields
Follow-up for: 32b3aabfe7
2026-08-19 02:31:39 +09:00
Daan De Meyer 57c4a1ea32 vmspawn: terminate the child processes before removing the runtime directory
The runtime directory holds what the helpers we fork off need: swtpm's socket
and, unless --tpm-state= points elsewhere, its state, the virtiofsd sockets,
the varlink control socket, and the QEMU config file. runtime_dir was declared
after the CLEANUP_ARRAY() that terminates those helpers, and cleanup handlers
run in reverse declaration order, so the directory was removed while all of
them were still running. That produces spurious errors from the helpers, and
anything they create while rm_rf() walks the tree can make the final rmdir fail
and leave the runtime directory behind.

Declare runtime_dir before the CLEANUP_ARRAY() instead, so the helpers are sent
SIGTERM and reaped first and the directory only goes away once nothing writes
to it anymore.

While at it, drop the rm_rf_physical_and_freep() destructors from the SSH key
paths. They are only ever assigned paths below the runtime directory, whose
removal takes them along, so those destructors never had an effect.
2026-08-19 02:30:42 +09:00
dongshengyuan 844c44a0d4 timedated: roll back state on config write failure
SetTimezone() and SetLocalRTC() updated the Context before writing
/etc/localtime or /etc/adjtime. If the write failed, D-Bus properties
showed the new value and a repeated request with the same value returned
success without retrying the file update.

Keep the write helpers Context-based, but save the old value before
installing the requested state. Restore the old Context value when the
backing file update fails.

Add TEST-45 coverage for failed alternate localtime and adjtime paths.

Follow-up for: f401e48c2d
2026-08-19 02:29:39 +09:00
dongshengyuan 31ef154f15 core: fix integer truncation checks
Use explicit bounds checks for size_t and long conversions
so compilers cannot optimize away round-trip cast checks.

Follow-up for 78238fd7c9.
2026-08-19 02:28:19 +09:00
Zbigniew Jędrzejewski-Szmek f969973b90 Another batch of conversions to COMMAND and additions of --introspect-cli (#43428) 2026-08-18 18:32:55 +02:00
Zbigniew Jędrzejewski-Szmek 92a97a2b9d dissect: describe the mount.ddi helper interface
Add a second COMMAND() for the mount.ddi helper namespace, like for
mount.storage and mount.mstack, so that it is exposed by --introspect-cli
too.

Fixes 1a54ce154c +
66246c98b5.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek da26e6f744 run0: add --no-pager
Since run0 --help now goes through the pager, provide a way to turn that
off from the command line, like all other commands that page --help. The
option is documented the same way as for systemd-run.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 38d854b114 vpick: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. An explicit "Lookup Keys" option group is added
so that the section heading stays the same.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek b4199e7376 vmspawn: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 60dee66134 tmpfiles: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. An explicit "Commands" option group is added
so that the section heading stays the same. The synopsis is now the same
as for systemd-sysusers, i.e. the "commands" are the options listed in the
Commands section. --help now goes through the pager, like other commands
with --no-pager.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 6109c2a707 sysusers: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. An explicit "Commands" option group is added
so that the section heading stays the same. The abstract is changed to the
imperative. --help now goes through the pager, like other commands with
--no-pager.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 0cbeceaea2 updatectl: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The odd "Verbs" option group marker is dropped,
so that all options are listed in one section after the verbs, with --help
and --version first. The synopsis now uses the generic "[OPTION…] COMMAND …"
form: a bare VERSION is not accepted as the first argument, and the man
page does not list it either. --help now goes through the pager, like
other commands with --no-pager.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek adc83f020a sysupdate: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The "Options" group marker after --help/--version
is dropped, so that all options are listed in one section after the verbs.
The synopsis now uses the generic "[OPTION…] COMMAND …" form: a bare
VERSION is not accepted as the first argument, and the man page does not
list it either. --help now goes through the pager, like other commands
with --no-pager.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 388eb27018 sysctl: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. An explicit "Commands" option group is added
so that the section heading stays the same. The abstract is changed to the
imperative. --help now goes through the pager, like other commands with
--no-pager.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek ae6f195d63 storagectl: 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. The mount.storage helper interface is described
by a second COMMAND(), so that it is exposed by --introspect-cli too.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 3a2d587313 run: convert to VERB_COMMAND and add --introspect-cli
The custom help() and help_sudo_mode() are replaced by COMMAND()
descriptions for systemd-run and run0, and --introspect-cli is added to
both. run0 --help now goes through the pager, like systemd-run --help.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek be5ae9fb40 repart: 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-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 19a24f926d pcrlock: 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-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek bf08fc692a nspawn: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The generic options at the top now get an
"Options" heading like the other groups.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek a9f42ed015 mstack: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The "Commands" option group is moved before the
other options and an explicit "Options" group is added, so that the sections
are printed in the same order as before. --help now goes through the pager,
like other commands with --no-pager. The mount.mstack helper interface is
described by a second COMMAND(), so that it is exposed by --introspect-cli
too.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 20cc6d3188 measure: 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-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 24e24adfe1 machine-id-setup: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. An explicit "Commands" option group is added
so that the section heading stays the same.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek facaf8ba45 machinectl: 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 now wrapped automatically.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 1c7253ca8f loginctl: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 8aee2501f8 journalctl: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The description refers to the "journalctl"
option namespace; the varlink-mode namespace is not described.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek f17f7cc35e imdsd: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 431e3f7def cryptenroll: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added.
2026-08-18 16:54:09 +02:00
Zbigniew Jędrzejewski-Szmek 6868cee66f bootctl: convert to VERB_COMMAND and add --introspect-cli
The custom help() is replaced by a COMMAND() description, and
--introspect-cli is added. The "help" verb was defined as visible but the
old help() only printed the named verb groups, so it was never shown; it is
now hidden explicitly to keep the output unchanged.
2026-08-18 16:54:09 +02:00
Antonio Alvarez Feijoo e1515be25b clonesetup-generator: set IgnoreOnIsolate=yes on generated units
If /sysroot is mounted in the initrd on a cloned device, initrd-cleanup.service
will stop this unit (via `systemctl isolate initrd-switch-root.target`).

cryptsetup-generator, veritysetup-generator and integritysetup-generator all set
"IgnoreOnIsolate=yes" on their generated units for this reason.
2026-08-18 20:18:03 +09:00
Zbigniew Jędrzejewski-Szmek 4db6101058 coccinelle: increase coverage by the coccinelle checker (#43412) 2026-08-18 13:16:06 +02:00
Daan De Meyer 1807f827ed ci: don't run the review agent outside the workspace
Running the review step from /tmp/claude-review-sandbox put the directory the
review result has to be written to outside the agent's working directory. The
Write tool refuses to touch anything outside that directory, no matter what the
permission rules say, so every attempt to write review-result.json was denied.
Runs only passed because the agent fell back to writing the file from a
sandboxed shell command instead, and the last one hit the 50 minute step
timeout before it got that far, leaving nothing for the post job to upload.

The separate working directory bought little on top of the write allow rule,
which already confines the agent to claude-review-work/, so drop it and run in
the workspace again.
2026-08-18 10:41:39 +01:00
Zbigniew Jędrzejewski-Szmek d4fe62b8b3 Another batch of conversions to COMMAND and additions of --introspect-cli (#43418) 2026-08-18 11:38:45 +02:00
Zbigniew Jędrzejewski-Szmek a8e07fef9a bless-boot: make 'help' work also in containers
TEST-74-AUX-UTILS.introspect-cli.sh would fail because
'systemd-bless-boot help' would refuse to run in a container.
It's nicer to make 'help' work always.
2026-08-18 00:33:55 +02:00
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 a508a1da5b inhibit: pass arg_json_format_flags to introspect_cli()
All other commands with a --json= option do so, so that --json= governs
the formatting of the introspection output.

Fixes 548c9cd71c.
2026-08-17 16:11:09 +02:00
Zbigniew Jędrzejewski-Szmek f2194e053f test: also exercise the "help" verb of introspectable commands
Verb-based commands register the help verb with
VERB_COMMON_HELP_AUTO("name"), where the name is spelled separately from
the one used for --help, so let's check that it works too.
2026-08-17 16:11:09 +02:00
Zbigniew Jędrzejewski-Szmek 10468a0164 meson: mark userdbctl as public
It is a documented user-facing tool installed into bindir like the other
*ctl tools, so give it the check-help and check-version tests too.
2026-08-17 16:11:09 +02:00