mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-11 15:40:58 +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
|
fi # end of DISPLAY block
|
||||||
|
|
||||||
# parse the pinentry output
|
# parse the pinentry output
|
||||||
|
local pinentry_error
|
||||||
for i in ${(f)output}; do
|
for i in ${(f)output}; do
|
||||||
[[ "$i" =~ "^ERR.*" ]] && {
|
[[ "$i" =~ "^ERR.*" ]] && {
|
||||||
_warning "Pinentry error: ::1 error::" ${i[(w)3]}
|
pinentry_error="${i[(w)3]}"
|
||||||
print "canceled"
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# here the password is found
|
# here the password is found
|
||||||
[[ "$i" =~ "^D .*" ]] && password="${i##D }";
|
[[ "$i" =~ "^D .*" ]] && password="${i##D }";
|
||||||
done
|
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
|
# if sphinx mode is chosen, use the provided input
|
||||||
# as master password to retrieve the actual password
|
# as master password to retrieve the actual password
|
||||||
if option_is_set --sphx-user || option_is_set --sphx-host; then
|
if option_is_set --sphx-user || option_is_set --sphx-host; then
|
||||||
|
Loading…
Reference in New Issue
Block a user