diff options
| author | João Lucas <jlucas@disroot.org> | 2025-01-04 00:46:36 +0000 |
|---|---|---|
| committer | João Lucas <jlucas@disroot.org> | 2025-01-04 00:46:36 +0000 |
| commit | d5dee1e1aabe0527d4cf35428c84fad5dfa503f6 (patch) | |
| tree | 8e8ad2178b6a7e011a58c2c354970a41d0b84728 | |
| parent | 931135ba08cabdc9cfe547d16fceb14ef0d3e22e (diff) | |
| download | anypinentry-d5dee1e1aabe0527d4cf35428c84fad5dfa503f6.tar.gz anypinentry-d5dee1e1aabe0527d4cf35428c84fad5dfa503f6.zip | |
implement SETERROR
Diffstat (limited to '')
| -rwxr-xr-x | anypinentry | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/anypinentry b/anypinentry index 8808939..6f9cdb3 100755 --- a/anypinentry +++ b/anypinentry @@ -13,6 +13,7 @@ prompt_string_default="PIN: " title=""; prompt_string="$prompt_string_default"; +error_string=""; description=""; keyinfo=""; repeat=""; @@ -27,7 +28,7 @@ display_error_action='notify-send -a "Pinentry" "$AP_ERROR"'; # :: Prompt string (default if empty) ask_password() { - export AP_PROMPT="${1:-"$prompt_string"}"; + export AP_PROMPT="${error_string}${1:-"$prompt_string"}"; printf '' | sh -c "$prompt_action" 2> /dev/null; } # :: Prompt string (default if empty) @@ -51,6 +52,7 @@ unknown_error() { echo "ERR 536871187 Unknown IPC command <User defined source 1 reset() { description= prompt_string="$prompt_string_default" + error_string= keyinfo= repeat= error__password_mismatch= @@ -100,6 +102,7 @@ password_prompt() { cancelled_error; fi; repeat= + error_string= } # :: OK | ERR @@ -109,6 +112,7 @@ confirm_prompt() { else cancelled_error; fi + error_string= } pinentry_help() { @@ -167,7 +171,7 @@ interpret_command() { SETKEYINFO) keyinfo="$data"; echo "OK" ;; SETREPEAT) repeat="${data:-"repeat"}"; echo "OK" ;; SETREPEATERROR) error__password_mismatch="$data"; echo "OK" ;; - SETERROR) not_implemented_error ;; + SETERROR) error_string="[$data] "; echo "OK" ;; SETOK) setok="$data" ;; SETNOTOK) setnotok="$data" ;; SETCANCEL) setcancel="$data" ;; |
