Repository navigation
Conversation
Under sudo's default verifypw=all, one password-requiring entry anywhere in the policy is enough to make `sudo -v` prompt, so a user who enabled passwordless sudo could not validate credentials without a password. The installer's own admin grant is password-requiring, and package drop-ins add more, so the grant cannot be the only entry that carries NOPASSWD. The published grant now carries the sudoers default that makes validation read the grant instead of every other entry, and a grant published before that default existed is rewritten in place.
The default was unqualified, so publishing a grant for one account changed the credential validation of every account on the host, and displaced a verifypw setting an administrator had configured. The default now names the account the grant belongs to, and a file whose default names another account is not read as this command's grant.
[Medium impact] The PR appears safe to merge; the previously reported migration failure is fixed. SummaryThe PR adds account-scoped
Reviews (2) · Last reviewed commit: "Reach the grant upgrade through the comm..." · Reviewed by Greptile |
The action was only reachable from inside the script, so the migration's call fell through to the user-facing arguments, valid_duration rejected it and the helper exited 1. That would have stopped omarchy-migrate on every machine that reached the migration and left every later migration pending. The action is dispatched now, and the test drives it through the executable and through the migration itself.
|
Thanks for this, @statick88. The diagnosis holds. omabot could not push to What was checked, on a disposable Omarchy worker running sudo 1.9.17p2, with a test account that has a password-requiring rule beside the grant:
Fixed on top:
Both findings came from the second opinion, Codex Medium, and were reproduced on the worker before they were fixed. Its second round on the fixes found nothing further to change; independence is not guaranteed, since it can read this session. This is related to, not a replacement for, #15729. Continued in #16223. |
Lets
sudo -vvalidate against the passwordless sudo grant.Under sudo's default
verifypw=all,sudo -vasks for a password unlessevery entry the user has in sudoers carries
NOPASSWD. The installer'sown admin grant (
/etc/sudoers.d/04_<user>) is password-requiring, andpackage drop-ins such as
50-asdcontroladd more, so a user who enabledpasswordless sudo could not validate their credentials without a password.
omarchy-updatealready works around this by authorizing withsudo trueinstead of
sudo -v.Measured on a machine with the grant enabled:
Removing only
50-asdcontrolleaves the failure, removing only04_<user>leaves it too, and removing both makessudo -vsucceed. Thegrant cannot be the only passwordless entry, so the fix belongs to the
command that publishes the grant.
omarchy-sudo-passwordlessnow publishes a sudoers default above the ruleit already wrote:
The default is scoped to the account that asked for the grant. An
unqualified
Defaultsline would change the rule for every account on thehost and displace a
verifypwsetting an administrator had configured; afile whose default names another account is not read as this command's
grant. A grant published before the default existed keeps working, and a
migration rewrites it in place with the default it is missing.
The grant file is removed when the grant is revoked or expires, so the
default goes with it and leaves the policy it changed exactly as it was.
Relates to omacom/omarchy-pkgs#970, where the drop-in that was blamed is shipped.
Tested with
test/shell.d/passwordless-sudo-verifypw-test.sh, which pins thepublished policy, the account the default is scoped to, the readback of a
grant published before the default existed, and the upgrade path. The
existing passwordless sudo suites still pass unchanged.