summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Pujol <alexandre@pujol.io>2017-02-03 18:06:57 (GMT)
committer Alexandre Pujol <alexandre@pujol.io>2017-02-03 23:57:52 (GMT)
commite8384ec7ac2b86cce3c509a1ac35efa2b7bfb380 (patch)
treeedeb33037d2cf2f232792adf130a92b01b17ea9d
parent6f89dbd2fec992e6b386fc048e7a0fe89dccc38a (diff)
Allow opening a tomb without giving a valid recipient.
The -r option always requires an arguments. However GPG does not need any recipient when decrypting a key. In order to be able to open a tomb without writing (the long) recipient, the user can use the -f option to short-cut the valid recipient checking. A dummy recipient is still required.
-rwxr-xr-xtomb2
1 files changed, 1 insertions, 1 deletions
diff --git a/tomb b/tomb
index 15ff175..5a76b78 100755
--- a/tomb
+++ b/tomb
@@ -992,7 +992,7 @@ gpg_decrypt() {
{ option_is_set -r } && {
typeset -a recipients
recipients=(${(s:,:)$(option_value -r)})
- { is_valid_recipients $recipients } || {
+ { ! is_valid_recipients $recipients } && { ! option_is_set -f } && {
_failure "You set an invalid GPG ID."
}
gpgpass="$TOMBKEY"