commit 90e46854bc89700a15d61986581ebc5ca493e68d
parent ca012e8744198343ed577cffae7e86ef8532cd86
Author: Jaromil <jaromil@dyne.org>
Date: Tue, 27 Jan 2015 17:31:09 +0100
handle failure in load_key when key is not retrieved from stdin
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/tomb b/tomb
@@ -879,6 +879,12 @@ _load_key() {
_verbose "load_key: ::1 key::" $TOMBKEYFILE
+ [[ "$TOMBKEY" = "" ]] && {
+ # something went wrong, there is no key to load
+ # this occurs especially when piping from stdin and aborted
+ _failure "Key not found, specify one using -k."
+ }
+
is_valid_key $TOMBKEY || {
_warning "The key seems invalid or its format is not known by this version of Tomb."
_tomb_key_recover $TOMBKEY