From dd2703096f3ee7f4b6b96e2b649daf85aa8d6030 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Wed, 11 Nov 2020 09:13:13 +0900 Subject: [PATCH] gpg: Fix the previous commit. * g10/delkey.c (do_delete_key): Fix the condition for the error. Signed-off-by: NIIBE Yutaka --- g10/delkey.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/g10/delkey.c b/g10/delkey.c index 05b9301ee..458c451e0 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" @@ -152,7 +153,8 @@ do_delete_key (ctrl_t ctrl, const char *username, int secret, int force, if (opt.batch && exactmatch) { - if (!opt.answer_yes && secret) + if (secret && opt.pinentry_mode == PINENTRY_MODE_LOOPBACK + && !opt.answer_yes) log_error(_("can't do this in batch mode without \"--yes\"\n")); else okay++;