Skip to content

Don't report Tailscale removal as done after a cancelled sudo - #9528

Open
AtypicalMike wants to merge 1 commit into
omacom:quattrofrom
AtypicalMike:fix/tailscale-remove-cancel
Open

Don't report Tailscale removal as done after a cancelled sudo#9528
AtypicalMike wants to merge 1 commit into
omacom:quattrofrom
AtypicalMike:fix/tailscale-remove-cancel

Conversation

@AtypicalMike

Copy link
Copy Markdown

Fixes #9526

Cancelling sudo during Remove → Tailscale still printed Tailscale has been removed., showed green Done!, and disabled the bar plugin / web app / Taildrop receive service. The package and tailscaled stayed installed because the privileged steps never ran.

sudo at a password prompt exits 1 on Ctrl+C (PAM conversation failed), not 130. The remove script swallowed that with || true, kept going, and always echoed success. The presentation wrapper then treated every non-130 exit as success.

Remove script: authenticate with sudo -v before any teardown, map a cancelled prompt to exit 130, and stop swallowing systemctl disable failure.

Presentation: show Done! only on exit 0; on other non-cancel failures show Failed and still wait for a key so the error stays readable.

bash test/shell.d/remove-service-tailscale-test.sh
bash test/shell.d/floating-terminal-test.sh
./test/cli
sudo at a password prompt exits 1 on Ctrl+C, not 130. The remove script
swallowed that, kept disabling the plugin and web app, and always printed
success. Authenticate first, abort with 130 on a cancelled sudo, and only
show Done when the command actually succeeded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant