From 2f29e6709cc070a78d12e32ecf90987b18398467 Mon Sep 17 00:00:00 2001 From: Mark Mykkanen Date: Mon, 23 Mar 2020 17:07:46 -0500 Subject: [PATCH] Allow pinentry to fail, so long as the password comes through. --- tomb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tomb b/tomb index 9d50caf..b98aa9c 100755 --- a/tomb +++ b/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