Skip to content

fix: use installed sudo without cached authentication - #43

Merged
MrPointer merged 5 commits into
mainfrom
fix/installer-sudo-permissions
Nov 14, 2026
Merged

MrPointer merged 5 commits into
mainfrom
fix/installer-sudo-permissions

Conversation

@MrPointer

@MrPointer MrPointer commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

📝 Summary

The installer now selects installed sudo before doas without probing cached authentication, so password-required sudo can authenticate when the privileged command runs.
Non-root users without either tool receive an actionable error instead of an unprivileged fallback; direct execution as root is unchanged.
New real-authentication checks cover APT and shell setup, with matching unit coverage for APT, DNF, and shell error propagation.
The change also updates installer documentation and explicitly configures the three Go worker model variants.

Key Decisions

🔐 Select Privilege Tools Without Authenticating

Tool selection now checks whether sudo or doas is installed, not whether it can run without a password. The selected command authenticates through the controlling terminal when it executes; the installer does not collect or store passwords. If neither tool is installed for a non-root user, the operation fails with guidance rather than retrying unprivileged.

🧪 Test Real Password Authentication

Disposable Ubuntu and Debian checks run the real APT and shell-setup paths with a cold sudo cache. They verify both accepted and rejected passwords, require root-owned effects only after authentication, and reject any unprivileged retry. The shared runner requires explicit disposable-machine opt-in, resets state between cases, cleans up test state, and uses a local package fixture without downloading packages.

Native Ubuntu CI runs task test:privilege; an optional offline Docker runner supports local macOS testing. The privilege job participates in the aggregate CI gate, including cancellation failure. Unit tests cover propagation of privilege failures for APT, DNF, and shell operations.

The worker configurations now use openai/gpt-6-luna#high, openai/gpt-6.1-terra#medium, and openai/gpt-6.1-sol#medium.

🔄 Before & After

Area Before After
Non-root privilege selection Probed non-interactive authentication and could fall back to direct execution Selects installed sudo, then doas; reports a missing-tool error otherwise
Password-required sudo Could be excluded when no cached authorization existed Prompts through the controlling terminal when the privileged command runs
Regression coverage No real password-authentication coverage Real APT and shell tests for accepted and rejected passwords, plus unit error-propagation tests

@MrPointer
MrPointer force-pushed the fix/installer-sudo-permissions branch from a19c119 to 4d7afb6 Compare November 14, 2026 18:45
Select installed sudo or doas without probing cached authentication. Fail
closed when neither tool is installed rather than running privileged
operations as an unprivileged user.

Add Go regressions for tool selection and error propagation without
unprivileged retries in package installation and shell changes.
Set explicit model variants for each worker tier and align the cheapest
worker instructions with its configured reasoning effort.
Verify real password authentication and protected effects through the
installer's package and shell setup paths, including rejected passwords
without unprivileged retries.

Run shared checks directly on disposable Ubuntu CI runners. Keep an
optional dependency-only image for local testing and document the
privilege behavior, test entry points, and safety requirements.
Use the default authentication timestamp scope and set the test prompt
through SUDO_PROMPT instead of unsupported sudoers settings.

Keep the same authentication and protected-effect assertions for both
traditional sudo and sudo-rs.
Treat rejected authentication as a passing error assertion in Go rather
than an expected test-process failure. Require successful Go test exits
for every scenario so unexpected assertion failures fail the CI job.
@MrPointer
MrPointer force-pushed the fix/installer-sudo-permissions branch from 4d7afb6 to d332b94 Compare November 14, 2026 18:58
@MrPointer
MrPointer merged commit 8bdcb09 into main Nov 14, 2026
10 checks passed
@MrPointer
MrPointer deleted the fix/installer-sudo-permissions branch November 14, 2026 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant