gpg: In batch mode, delete-secret-key is not okay without --yes.

* g10/delkey.c (do_delete_key): Emit an error when not --yes.

--

GnuPG-bug-id: 4667
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-11-10 14:08:24 +09:00
parent 9854369a72
commit f9bbc75163
1 changed files with 6 additions and 1 deletions

View File

@ -151,7 +151,12 @@ do_delete_key (ctrl_t ctrl, const char *username, int secret, int force,
if (opt.batch && exactmatch)
okay++;
{
if (!opt.answer_yes && secret)
log_error(_("can't do this in batch mode without \"--yes\"\n"));
else
okay++;
}
else if (opt.batch && secret)
{
log_error(_("can't do this in batch mode\n"));