summaryrefslogtreecommitdiff
path: root/lib/GnuPG/Interface.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/GnuPG/Interface.pm')
-rw-r--r--lib/GnuPG/Interface.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/GnuPG/Interface.pm b/lib/GnuPG/Interface.pm
index 13b313e..905ae30 100644
--- a/lib/GnuPG/Interface.pm
+++ b/lib/GnuPG/Interface.pm
@@ -29,7 +29,7 @@ use GnuPG::Options;
use GnuPG::Handles;
use Scalar::Util 'tainted';
-$VERSION = '1.01';
+$VERSION = '1.02';
has passphrase => (
isa => 'Any',
@@ -336,6 +336,13 @@ sub fork_attach_exec( $% ) {
}
my @args = $self->options->get_args();
+
+ # Get around a bug in 2.2, see also https://dev.gnupg.org/T4667
+ # this covers both --delete-secret-key(s) and --delete-secret-and-public-key(s)
+ if ( $self->version && $self->cmp_version( $self->version, 2.2 ) >= 0 && $commands[0] =~ /^--delete-secret-.*keys?$/ ) {
+ push @args, '--yes';
+ }
+
push @args, '--pinentry-mode', 'loopback'
if $use_loopback_pinentry;