Skip to content

Name what the installed passwordless sudo helper lacks when a root action fails - #13454

Closed
spencerbull wants to merge 1 commit into
quattrofrom
fix/passwordless-installed-helper-mismatch
Closed

spencerbull wants to merge 1 commit into
quattrofrom
fix/passwordless-installed-helper-mismatch

Conversation

@spencerbull

Copy link
Copy Markdown
Contributor

omarchy-sudo-passwordless runs its status, enable and disable actions as root through the installed /usr/bin/omarchy-sudo-passwordless, whichever copy the user started. That is deliberate: the root half, its expiry timer and the pacman hook must all be root-owned code. When a root action fails because of what is installed, though, the interface does not say so. Two cases hit it:

  • Every package built from current quattro. omarchy-pkgs does not yet install 05-omarchy-passwordless-revoke.hook ([codex] Revoke passwordless grants when settings is removed omarchy-pkgs#257 does), so publication refuses. __enable fails, and under set -e the interface exits 1 without a word.
  • An install whose /usr/bin copy predates the one started, as under omarchy dev link with older packages. The old copy answers __status with its usage text, and the user sees "Could not safely inspect passwordless sudo… Resolve the reported authorization or cleanup error first", which points at the wrong problem.

On those failures the interface now also says what it can see without root: that the installed copy differs from the one started, naming both paths and omarchy dev pkg-test, and which of the boot cleanup rule and revocation hook is not installed. A failed enable or disable now says so and keeps its exit status. On a consistent install nothing extra is printed, including for a copy at another path whose bytes match. Nothing changes about which copy runs as root.

The test fixture maps INSTALLED_SELF to its generated copy, so these cases do not depend on what the test machine has installed. docs/passwordless-sudo.md now says the root actions always use the installed copy, and that the legacy cleanup migration is the one exception.

Refs #13421, the report behind this. Its migration half was #13350, and its packaging half is omacom/omarchy-pkgs#257. Not covered here: __status still reads only the UID-named rule, so an old-format rule under the reserved prefix is not reported as active.

🤖 Generated by Opus 5.5 in Claude Code. Reviewed by Codex XHigh.

…tion fails

Status, enable and disable always run /usr/bin/omarchy-sudo-passwordless as root, whichever copy the user started. When that copy is older than the one started, as under a dev link whose packages predate the checkout, or the boot cleanup rule or revocation hook is missing, the interface reported a generic authorization error, and a failed enable or disable exited without a word. Say which of those is the case instead, keeping the failed action's exit status. Nothing about which copy runs as root changes.

Co-Authored-By: Codex XHigh <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants