Repository navigation
[codex] Revoke passwordless grants when settings is removed - #257
AFOliveira wants to merge 9 commits into
Conversation
1545a9b to
84806c5
Compare
|
LGTM - pending 9457 |
b787991 to
32c1415
Compare
|
After changes:
|
makepkg resolves dependencies against the static pkgver before it runs pkgver(), so the omarchy-dev package's exact same-version dependency on omarchy-settings-dev requested the stale placeholder release even after the builder had produced newer settings. The builder already refreshed VCS versions before the real build, but only for packages with a dotted local pkgrel. Run the refresh for every VCS package. Dotted pkgrels are still restored afterwards; integer pkgrels keep makepkg's normal reset. The real build then runs with --holdver so it packages the revision the refresh fetched and the dependency check validated, rather than fetching the branch a second time. The resulting package retains the exact dependency, now on the refreshed version. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
pacman does not stop a transaction when a scriptlet fails, so a failed or interrupted pre_upgrade fallback could be followed directly by post_upgrade, which cleared the removal blocker on a bare file check while a passwordless rule was still live. The same happened when an interrupted removal left the blocker and a rule behind and a later fresh install completed, and a fresh install has no earlier step at all. On completion, hold the blocker, sweep the reserved sudoers prefix, and remove the blocker only once nothing remains and the boot cleanup is present; a sweep that fails leaves publication refused. Run that recovery before the optional /etc overrides so an override failure cannot strand the blocker, bound the shared lock wait so a stalled grant operation cannot hang pacman indefinitely, and clear inherited glob state so the sweep cannot be blinded by pacman's environment. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Fixed in 21b3b32, now at 9b9a9c8. The builder's VCS refresh runs for every VCS package, so dependency resolution sees the refreshed pkgver and the package keeps the exact settings dependency; the real build uses The same head hardens the scriptlets: completion writes the blocker before waiting for the lock, sweeps the reserved prefix, and clears the blocker only when nothing remains and the boot cleanup is present, so a failed |
|
@ryanrhughes this is not a feature, but a security fix. |
|
@ErikMelton @ryanrhughes #9457 has been merged, can we get this in as well? Thanks! |
|
Reviewed at Why it is needed. Since omarchy Transaction flows, each on its own fresh worker cloned from a 4.0.4 install. The stable pair was built as 4.0.98 and 4.0.99, plus the dev pair, all from the merged recipes with
83 checks, none failing. omarchy's Blocking, as merged onto master today:
Lower:
Second opinion: Codex XHigh reviewed the diff against master. It found both blockers and the Open: a maintainer's choice on the |
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
Signed-off-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
|
@spencerbull please take another look at d2837e7. Both channels now match settings by The dev packages were rebuilt from the current declared pin and tested in an x86_64 VM, including grant revocation/recovery, runtime/settings removal and a settings-only revision bump. The stable source pin remains a merge prerequisite: 4.0.4 lacks the hook/library, and its declared build still fails. This needs the release containing the fix selected and built before merging. |
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
|
Rebase / scope note after #645 (c35e69a, rebased onto b7a7ad1 and reporting MERGEABLE): This branch sits on 7228983 and merging master conflicts in 3 files: pkgbuilds/omarchy-dev/PKGBUILD (pin r6663 vs r6689), pkgbuilds/omarchy-settings-dev/PKGBUILD (same pin plus the #701 runtime-profile rework in the same hunks), and pkgbuilds/omarchy-settings/PKGBUILD (pkgrel 3 vs 4, hook placement vs the same rework). The dev half is now redundant: #645 ships the same helper/hook move, scriptlets, and lifecycle tests for the dev pair. One difference to be aware of when trimming — this branch pins "omarchy-settings-dev=${pkgver}" (exact), which #645 found breaks the per-package PR/publish builds with "target not found"; #645 uses an unversioned dep plus a conflicts floor instead. Suggested sequence:
I have pushed nothing here since the trim + pin bump are maintainer/author choices. |
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from omacom#257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com>
* Move the dev sudo grant lifecycle into omarchy-settings-dev The hardened omarchy-sudo-passwordless publishes a grant only when its revocation hook is installed and no package transaction has left /run/omarchy-sudo-passwordless-package-removing behind. The hook sets that marker before every settings upgrade, and the settings scriptlets are what clear it, so shipping the hook alone let the first grant work and then refused every grant after the next update until a reboot. omarchy-settings-dev now ships the command, omarchy-security-functions, the boot cleanup rule and the hook together, with the scriptlets from #257 that revoke before the package changes and clear the marker once no grant remains. omarchy-dev stops shipping the two helpers and requires the settings release that does: without it omarchy-update has no library to source. Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com> * Check that settings-dev registers the scriptlet the lifecycle test exercises The lifecycle test reads the .install file directly, so it kept passing with the recipe's install= line gone, which is the one change that would strand the hook's marker again. Co-Authored-By: Codex XHigh <noreply@openai.com> * Keep omarchy-dev's settings dependency unversioned The dev pair builds each package on its own against the published edge repository, in the PR build and in publish alike, so omarchy-dev cannot require a settings-dev release that only this change produces: the floor failed both omarchy-dev builds on this PR, and an exact pkgver match would fail the same way on every upstream pin bump. Nothing needs it. The upstream watch moves both pins together, publish stops the run before anything is published when one package fails, and a new settings-dev over an old runtime is refused on the files they would both own. * Refuse settings-dev releases that predate the grant helper move With the dependency unversioned, a new omarchy-dev could still install over a settings-dev that is held back or not yet published, removing omarchy-security-functions from both, and omarchy-update cannot start without it. A versioned conflict refuses that pairing at install time without constraining the per-package builds, which resolve only depends. Co-Authored-By: Codex XHigh <noreply@openai.com> * Require the security library as a capability instead of a version floor The conflict named the last settings-dev release without the helpers, a version that moves with every upstream pin bump and settings-only pkgrel while this change waits to merge, and a rebase that kept a stale floor still passed the tests while the published release slipped past it. omarchy-settings-dev now provides omarchy-security-functions and omarchy-dev's package() requires it. makepkg checks only the top-level depends before building, so the per-package builds still resolve against the published repository, while pacman refuses a runtime without a settings release that ships the library, and pulls that release in when only the runtime is asked for. Co-Authored-By: Codex XHigh <noreply@openai.com> --------- Co-authored-by: Spencer Bull <spencer@omarchy.org> Co-authored-by: Afonso Oliveira <afonso.oliveira707@gmail.com> Co-authored-by: Codex XHigh <noreply@openai.com>
Settings owns the complete temporary sudo-grant lifecycle: publication helper, shared security library, boot cleanup and an aborting pre-transaction revocation hook. Removing only the desktop runtime preserves expiry support; upgrading or removing settings revokes the grant before those files disappear.
The hook and grant publication share one lock and a package-transition marker. Revocation failure aborts the ALPM transaction and blocks new grants until a successful retry. Scriptlets retain the legacy fallback for the first upgrade from packages without the hook; scriptlet errors are not claimed to abort that transaction.
Companion: Omarchy #9457. Rebased onto current
master(v4.0.4,c668141e) as three commits with no release bump of their own: the runtime packages now require the exactpkgver-pkgrelof their matching settings package in both channels, settings gains thesudodependency, the hook and the two helpers. #239 is separate overlapping ownership work, not a required parent.Not mergeable before #9457: the declared upstream source
c668141epredates it and cannot build these settings recipes. After #9457 lands, advance both release pins and checksums together to the real upstream commit containing it, bumppkgrelon the pair, build the declared sources, and publish each matching pair together. No fork revision or duplicate backport has been substituted for that upstream prerequisite.Validation at the rebased head: all four PKGBUILDs parse (
makepkg --printsrcinfo); the cross-repository suites in #9457 atea617b91(passwordless-grant-lifecycle-test.sh,nopasswd-sudo-expiry-test.sh) pass withOMARCHY_PKGS_PATHpointing at this checkout, including both settings scriptlets' revoke, block and recover paths and the native lock serialization against grant publication. Earlier heads were reviewed independently by Daybreak and exercised in a disposable VM (reinstall, stable/dev transfers, runtime and settings removal, aborting removal on a benign revocation error, recovery); native ARM runtime and fresh-ISO validation remain untested.