Skip to content

fix(sudo): avoid sudo -v password prompt under unattended runs and set verifypw=any - #9109

Closed
harshithnadig wants to merge 1 commit into
omacom:quattrofrom
harshithnadig:fix/sudo-passwordless-verifypw
Closed

harshithnadig wants to merge 1 commit into
omacom:quattrofrom
harshithnadig:fix/sudo-passwordless-verifypw

Conversation

@harshithnadig

Copy link
Copy Markdown

Problem

In #9066, running omarchy update on a system with omarchy sudo passwordless still prompts for a sudo password in omarchy-update-stay-awake and hangs if no human is present.

Cause

  1. Sudo's default verifypw=all demands a password if any rule (such as Arch's default %wheel rule) requires one, ignoring the NOPASSWD: ALL drop-in when sudo -v is executed.
  2. omarchy-update runs through script, allocating a PTY, so [[ -t 0 ]] evaluates true even in unattended runs.

Solution

  • Set Defaults:<user> verifypw=any in bin/omarchy-sudo-passwordless so sudo -v honors the passwordless grant.
  • In bin/omarchy-update-stay-awake, use non-blocking sudo -n -v when OMARCHY_UPDATE_UNATTENDED=1 is exported.

Fixes #9066

…t verifypw=any

In omacom#9066, 'omarchy update' stopped on an interactive sudo password prompt
in 'omarchy-update-stay-awake' because:
1. 'sudo -v' checks all sudoers rules under default 'verifypw=all', demanding
   a password even when a NOPASSWD rule exists alongside '%wheel'.
2. 'omarchy-update' allocates a PTY via 'script', causing [[ -t 0 ]] to evaluate
   true even during unattended runs.

- Write 'Defaults:<user> verifypw=any' in 'omarchy-sudo-passwordless'.
- Guard 'sudo -v' in 'omarchy-update-stay-awake' with 'sudo -n' under
  OMARCHY_UPDATE_UNATTENDED=1.

Fixes omacom#9066
@bjarneo

bjarneo commented Sep 21, 2026

Copy link
Copy Markdown
Member

Automated duplication check: this pull request looks similar to #9875, which covers the same stay-awake sudo probe. I keep that one open and close this one to consolidate review.

If you feel this is the wrong decision, please open the PR again with a note on the difference.

@bjarneo bjarneo closed this Sep 21, 2026
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.

omarchy update hangs on a sudo password prompt even after omarchy sudo passwordless

2 participants