This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

tools.pinentry-rofi: time out unanswered prompts

+10 -2
+10 -2
tools/pinentry-rofi/pinentry-rofi.sh
··· 13 13 CACHE_KEY="pinentry-rofi-pin" 14 14 CACHE_TIMEOUT=300 # 5 minutes 15 15 16 + # Hard limit on how long a dialog may sit unanswered. Without it, a prompt 17 + # nobody answers (lost workspace, requester already dead) hangs forever, and 18 + # ssh-tpm-agent serializes TPM access behind it: every later signature blocks, 19 + # so all ssh auth on the machine wedges until the stray rofi is killed by hand. 20 + # On expiry `timeout` exits 124, which the callers treat like a cancel, so the 21 + # requester gets a failed auth it can retry instead of a deadlock. 22 + PROMPT_TIMEOUT="${PINENTRY_ROFI_TIMEOUT:-120}" 23 + 16 24 # ---------- cache helpers ---------- 17 25 18 26 get_cached_pin() { ··· 106 114 local cached_pin="" 107 115 if cached_pin=$(get_cached_pin 2>/dev/null) && [[ -n "$cached_pin" ]]; then 108 116 local choice 109 - choice=$(printf "OK\nCancel\nClear cache" | rofi -dmenu \ 117 + choice=$(printf "OK\nCancel\nClear cache" | timeout -k 5 "$PROMPT_TIMEOUT" rofi -dmenu \ 110 118 -i \ 111 119 -no-custom \ 112 120 -no-fixed-num-lines \ ··· 131 139 fi 132 140 133 141 local result 134 - result=$(rofi -dmenu \ 142 + result=$(timeout -k 5 "$PROMPT_TIMEOUT" rofi -dmenu \ 135 143 -password \ 136 144 -p "$prompt_label" \ 137 145 -lines 0 \