OM-SEC-14: Run update hooks without reusable sudo authority

This commit is contained in:
Afonso Oliveira committed 2026-08-31 21:32:42 +01:00
1 parent b686ed892d
commit 1136a715c0
8 files changed
+1628 -41

No files matched your search

+4 -2
View File
@@ -14,8 +14,8 @@ file first, if one exists.
├── battery-low.d/ # Low battery (percentage in $1)
├── font-set.d/ # After font change (font name in $1)
├── post-boot.d/ # After the desktop starts
├── post-update.d/ # During `omarchy update`, after system packages and migrations
├── pre-refresh-pacman.d/ # Before `omarchy refresh pacman` re-syncs packages
├── post-update.d/ # At the end of `omarchy update`, after privileged work
├── pre-refresh-pacman.d/ # After `omarchy refresh pacman` finishes (legacy name)
└── theme-set.d/ # After theme change (theme slug in $1)
```
@@ -26,3 +26,5 @@ THEME_NAME=$1
echo "Theme changed to: $THEME_NAME"
# Add custom actions here
```
Update-related hooks run only after the workflow's privileged work and after Omarchy invalidates its sudo timestamp. A hook that invokes `sudo` must therefore request its own explicit authorization. The legacy-named `pre-refresh-pacman` hook runs after the refresh transaction; during `omarchy channel set`, it is deferred further until the package switch and complete update finish. Executable user code cannot safely run before a later sudo authentication because a detached child could wait for the new timestamp.