diff options
author | Werner Koch <[email protected]> | 2020-03-18 14:26:43 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-03-18 14:26:43 +0000 |
commit | fbe318475236166b54e19d228bf9b24e442e0fa5 (patch) | |
tree | 4cc77618faf15ea4f35a20ed49dedd843d4d74af | |
parent | dirmngr: Improve finding OCSP cert. (diff) | |
download | gnupg-fbe318475236166b54e19d228bf9b24e442e0fa5.tar.gz gnupg-fbe318475236166b54e19d228bf9b24e442e0fa5.zip |
gpg: Print a hint for --batch mode and --delete-secret-key.
* g10/delkey.c: Include shareddefs.h.
(delete_keys): Print a hint.
--
The option --yes has some side-effects so it is not desirable to use it
automatically. The code in master (2.3) has special treatment of
confirm messages and thus this patch is only for 2.2.
GnuPG-bug-id: 4667
Signed-off-by: Werner Koch <[email protected]>
-rw-r--r-- | g10/delkey.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/g10/delkey.c b/g10/delkey.c index 6116d7406..13dbcf062 100644 --- a/g10/delkey.c +++ b/g10/delkey.c @@ -38,6 +38,7 @@ #include "filter.h" #include "../common/ttyio.h" #include "../common/i18n.h" +#include "../common/shareddefs.h" #include "call-agent.h" @@ -368,6 +369,11 @@ delete_keys (ctrl_t ctrl, strlist_t names, int secret, int allow_both) { log_error ("%s: delete key failed: %s\n", names->d, gpg_strerror (err)); + if (gpg_err_code (err) == GPG_ERR_NO_PIN_ENTRY + && opt.batch && secret + && opt.pinentry_mode == PINENTRY_MODE_LOOPBACK) + log_info ("(try option \"--yes\" to delete anyway)\n"); + return err; } } |