Home GnuPG
Diffusion GnuPG f9bbc751633f

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

Description

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: T4667
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Event Timeline

This change breaks tests/openpgp/delete-keys.scm:

# cd tests/openpgp
# TESTS="delete-keys.scm" make check
[...]
PASS: tests/openpgp/setup.scm
("/home/ingo/dev/g10/build/gnupg/g10/gpg" --no-permission-warning --always-trust --delete-secret-keys "A0FF4590BB6122EDEF6E3C542D727CC768697734") failed: gpg: can't do this in batch mode without "--yes"

0: tests.scm:122: (throw (string-append (stringify what) " failed") (:stderr result))
1: delete-keys.scm:33: (call-check `(,@gpg --delete-secret-keys ,(*colon-hook* 'fpr key)))
FAIL: tests/openpgp/delete-keys.scm 
=================== 
1 tests run, 0 succeeded, 1 failed, 0 failed expectedly, 0 succeeded unexpectedly, 0 skipped. 
Failed tests: tests/openpgp/delete-keys.scm 
=================== 
make: *** [Makefile:923: xcheck] Error 1

Thanks.
I didn't consider well about the test environment which uses special pinentry program.
I'll fix the line 155.