Reach the migration's helper through $OMARCHY_PATH rather than by name
By name, the sudo call resolved through secure_path, which puts /usr/local/bin ahead of /usr/bin and falls back to the caller's PATH where no secure_path is set, so an install could run a different helper than the pinned path did. $OMARCHY_PATH/bin is the package's symlink into /usr/bin on an install and the checkout under a dev link, so neither PATH nor secure_path takes part. Co-Authored-By: Codex XHigh <noreply@openai.com>
This commit is contained in:
1 parent
2ffae36a18
commit
92ef7e9407
2 files changed
+9
-8
No files matched your search
@@ -1,8 +1,9 @@
|
||||
echo "Remove legacy temporary passwordless sudo grants"
|
||||
|
||||
# Migration queues are per-user; the privileged repair is once per machine.
|
||||
# By name: secure_path resolves /usr/bin on an install and the checkout under a
|
||||
# dev link, where the installed package may predate __migrate.
|
||||
if ! omarchy-sudo-passwordless __migration-complete; then
|
||||
sudo omarchy-sudo-passwordless __migrate
|
||||
# The helper beside this migration: the package's /usr/bin copy on an install,
|
||||
# and under a dev link the checkout's, which may be newer than the package.
|
||||
helper="$OMARCHY_PATH/bin/omarchy-sudo-passwordless"
|
||||
if ! "$helper" __migration-complete; then
|
||||
sudo "$helper" __migrate
|
||||
fi
|
||||
Reference in new issue
Block a user