From a70248376f3b01cb0219a20a02b256e8f195d2a0 Mon Sep 17 00:00:00 2001 From: Axel Burri Date: Sun, 29 May 2022 16:57:52 +0200 Subject: [PATCH] btrbk: use no-default-recipient on gpg encrypt In case the user has set a default recipient in his gpg config file, ignore it. --- btrbk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/btrbk b/btrbk index 14d3aa4..035f2b1 100755 --- a/btrbk +++ b/btrbk @@ -1750,8 +1750,9 @@ sub btrfs_send_to_file($$$;$$) my @gpg_options = ( '--batch', '--no-tty', '--no-random-seed-file', '--trust-model', 'always' ); push @gpg_options, ( '--compress-algo', 'none' ) if($compress); # NOTE: if --compress-algo is not set, gpg might still compress according to OpenPGP standard. push(@gpg_options, ( '--no-default-keyring', '--keyring', { unsafe => $encrypt->{keyring} } )) if($encrypt->{keyring}); - foreach(@$encrypt->{recipient} // []) { - push(@gpg_options, ('--recipient', $_)); + if($encrypt->{recipient}) { + push(@gpg_options, '--no-default-recipient'); + push(@gpg_options, map +( '--recipient', $_ ), @{$encrypt->{recipient}}); } push @cmd_pipe, { cmd => [ 'gpg', @gpg_options, '--encrypt' ],