mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-05 12:57:56 +00:00
Merge pull request #378 from quickcougar/pinentry-override
Allow pinentry to fail, so long as the password comes through.
This commit is contained in:
commit
f14ba758ee
13
tomb
13
tomb
@ -491,17 +491,22 @@ ask_password() {
|
||||
fi # end of DISPLAY block
|
||||
|
||||
# parse the pinentry output
|
||||
local pinentry_error
|
||||
for i in ${(f)output}; do
|
||||
[[ "$i" =~ "^ERR.*" ]] && {
|
||||
_warning "Pinentry error: ::1 error::" ${i[(w)3]}
|
||||
print "canceled"
|
||||
return 1
|
||||
[[ "$i" =~ "^ERR.*" ]] && {
|
||||
pinentry_error="${i[(w)3]}"
|
||||
}
|
||||
|
||||
# here the password is found
|
||||
[[ "$i" =~ "^D .*" ]] && password="${i##D }";
|
||||
done
|
||||
|
||||
[[ ! -z "$pinentry_error" ]] && [[ "$password" = "" ]] && {
|
||||
_warning "Pinentry error: ::1 error::" ${pinentry_error}
|
||||
print "canceled"
|
||||
return 1
|
||||
}
|
||||
|
||||
# if sphinx mode is chosen, use the provided input
|
||||
# as master password to retrieve the actual password
|
||||
if option_is_set --sphx-user || option_is_set --sphx-host; then
|
||||
|
Loading…
Reference in New Issue
Block a user