Repository navigation
fix(sudo): avoid sudo -v password prompt under unattended runs and set verifypw=any - #9109
Closed
harshithnadig wants to merge 1 commit into
Closed
harshithnadig wants to merge 1 commit into
harshithnadig wants to merge 1 commit into
Conversation
…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
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In #9066, running
omarchy updateon a system withomarchy sudo passwordlessstill prompts for a sudo password inomarchy-update-stay-awakeand hangs if no human is present.Cause
verifypw=alldemands a password if any rule (such as Arch's default%wheelrule) requires one, ignoring theNOPASSWD: ALLdrop-in whensudo -vis executed.omarchy-updateruns throughscript, allocating a PTY, so[[ -t 0 ]]evaluates true even in unattended runs.Solution
Defaults:<user> verifypw=anyinbin/omarchy-sudo-passwordlesssosudo -vhonors the passwordless grant.bin/omarchy-update-stay-awake, use non-blockingsudo -n -vwhenOMARCHY_UPDATE_UNATTENDED=1is exported.Fixes #9066