Merge pull request #378 from quickcougar/pinentry-override

Allow pinentry to fail, so long as the password comes through.
This commit is contained in:
Denis Roio 2020-06-22 10:05:31 +02:00 committed by GitHub
commit f14ba758ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

13
tomb
View File

@ -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