Repository navigation
feat(linux): service actions go through the helper: a refusal for want of authorization retries there, and Authenticate and retry starts it (#2728) - #3013
Merged
Conversation
…p, and can borrow one held system bus connection (#2728) The first slice of service actions through the helper (the maintainer chose: the helper opens the system bus as root before its privilege drop and seccomp sandbox, and keeps that one connection). startUnit(), stopUnit() and setUnitStartType() and their waits move out of SystemdUnits.cpp so the helper can link them alone, not the services read. holdSystemBusForActions() opens the system bus and keeps it; openForAction() then borrows that connection (Bus::borrow(), which drops its reference without closing it) instead of opening one per action. TaskSmack itself never holds one: no behavior change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…services over the system bus it opens as root before its sandbox (#2728) The second slice of service actions through the helper. ServiceActionRequest (an action, a unit, SetStartType's start type) and ServiceActionReply (the ServiceActionResult). The helper, before dropping root and installing its seccomp filter, holds the system bus (SystemdBus::holdSystemBusForActions()) where systemd runs; each request then goes over that connection as root, so systemd asks for no password. Only a service's unit name is accepted (SystemdActions::isServiceUnitName()). A service action puts off the idle exit like any action; Windows' helper answers it with an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…services over the system bus it opens as root before its sandbox (#2728) The second slice of service actions through the helper. ServiceActionRequest (an action, a unit, SetStartType's start type) and ServiceActionReply (the ServiceActionResult). The helper, before dropping root and installing its seccomp filter, holds the system bus (SystemdBus::holdSystemBusForActions()) where systemd runs; each request then goes over that connection as root, so systemd asks for no password. Only a service's unit name is accepted (SystemdActions::isServiceUnitName()). A service action puts off the idle exit like any action; Windows' helper answers it with an error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t of authorization retries there, and Authenticate and retry starts it (#2728) The third slice of service actions through the helper. BrokeredServiceActions decorates TaskSmack's own (Linux only; Windows' helper doesn't do them): an action systemd refuses only for want of authorization goes to a running helper with no prompt; Authenticate and retry starts the helper (one password, held for the session or a few minutes) and acts through it instead of letting polkit prompt per action; a helper that answers with an error leaves the refusal and polkit's own prompt as they were. The user guide says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t of authorization retries there, and Authenticate and retry starts it (#2728) The third slice of service actions through the helper. BrokeredServiceActions decorates TaskSmack's own (Linux only; Windows' helper doesn't do them): an action systemd refuses only for want of authorization goes to a running helper with no prompt; Authenticate and retry starts the helper (one password, held for the session or a few minutes) and acts through it instead of letting polkit prompt per action; a helper that answers with an error leaves the refusal and polkit's own prompt as they were. The user guide says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgradwohl
enabled auto-merge (squash)
October 26, 2026 04:04
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
…nly, where it's used (#2728) Windows' clang-tidy found it unused there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mgradwohl
disabled auto-merge
October 26, 2026 04:22
mgradwohl
enabled auto-merge (squash)
October 26, 2026 04:22
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Part of #2728: slice 3 of 3 for service actions through the helper, after #2984 and #3002. With this, service actions need no polkit password per action once the helper runs.
BrokeredServiceActions: decorates TaskSmack's ownIServiceActions.needsAuthorization: systemd would allow it with a password) is retried through a running helper with no prompt. Other failures, such as the running-dependents refusal, stay TaskSmack's own.authorizationUnavailable, and nothing is sent.capabilities()offers Authenticate and retry wherever the inner actions or the helper can.PanelPlatforms: composes it on Linux only. Windows' helper doesn't do service actions, so Windows keeps its own.That completes #2728's Linux list: the session hold, the access choice, the chip and title, FD counts and I/O, network attribution, hidepid listing, and now service actions.
PR Size
Type of Change
Checklist
clang-tidyand addressed any warningsclang-formaton my changespre-commit run --all-filesor installed pre-commit hooksTesting
TASKSMACK_REQUIRE_DISPLAY=1 TASKSMACK_REQUIRE_SDBUS=1 xvfb-run -a env -u WAYLAND_DISPLAY ctest --preset debug -j 4 # 684/684New
tests/Platform/test_BrokeredServiceActionsTest.*(a recording inner actions object plusFakeBroker):Additional Notes
v0.10.0, no backport.
🤖 Generated with Claude Code