colibri upgrade: privileged restart/install steps need scoped NOPASSWD sudo (or fail-fast hint) #300
Labels
No labels
doctor-fix
first-proof blocker
hardening
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
clawdie/colibri#300
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaced by the live
colibri upgradetest on debby (Linux), confirmed proven end-to-end otherwise.The privileged steps in
cmd_upgrade(crates/colibri-client/src/bin/colibri.rs) shell out to sudo:sudo systemctl stop|start colibri-daemon(Linux) /sudo service colibri_daemon stop|start(FreeBSD)sudo cp target/release/{colibri,colibri-daemon} /usr/local/bin/Without NOPASSWD or an interactive TTY + askpass, sudo prompts for a password and the upgrade hangs (or fails non-interactively). Same boundary on both platforms (systemd vs rc.d).
Options
clawdieinstaller writes a sudoers fragment granting NOPASSWD for only the exact daemon-control + install commands (not blanket sudo). Cross-platform: a systemctl variant and a service variant.colibri upgradefrom an interactive TTY (document it).sudo -n true; if it fails and no TTY, abort early with a clear hint ("upgrade needs passwordless sudo for daemon control — see deployment docs") instead of hanging.Recommend 1 + 3: ship the scoped sudoers via the installer, and have upgrade fail fast with a hint when it is missing. A matching
colibri doctorcheck ("daemon-control sudo available") would catch it before an upgrade is attempted.Refs the doctor/upgrade work in #295/#296.
did we test that on freebsd? i still see old reference for that part - we swapped for doas on freebsd