From 67a813d8d23d0783898b56aa8ed99d87d038a5ca Mon Sep 17 00:00:00 2001 From: Afonso Oliveira Date: Thu, 17 Sep 2026 20:37:17 +0100 Subject: [PATCH] Bound the grant lock wait The settings package's pre-transaction hook runs this command under pacman's transaction. Its lock wait was unbounded, so a stalled grant operation could hang pacman indefinitely before AbortOnFail ever saw a result. Grant operations are short; wait at most 60 seconds. Co-Authored-By: Claude Fable 5.1 --- bin/omarchy-sudo-passwordless | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/omarchy-sudo-passwordless b/bin/omarchy-sudo-passwordless index 58a9b15c..b5f88a94 100755 --- a/bin/omarchy-sudo-passwordless +++ b/bin/omarchy-sudo-passwordless @@ -86,7 +86,9 @@ with_root_lock() { exec {fd}>"$LOCK_FILE" || return 1 /usr/bin/chown root:root "$LOCK_FILE" || return 1 /usr/bin/chmod 0600 "$LOCK_FILE" || return 1 - /usr/bin/flock -x "$fd" || return 1 + # Grant operations are short. A stalled holder must not hang a caller + # indefinitely, least of all pacman's pre-transaction hook. + /usr/bin/flock -x -w 60 "$fd" || return 1 "$@" || rc=$? /usr/bin/flock -u "$fd" || rc=1 exec {fd}>&-