From 5adb486727f7e9a945ec3001c2c1b49f44f1c9d6 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Mon, 17 May 2021 15:42:35 -0500 Subject: [PATCH] Fix support for multiple GPG recipients (#342) --- test/test_encryption.py | 2 +- yadm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_encryption.py b/test/test_encryption.py index fea2ff0..73f4c35 100644 --- a/test/test_encryption.py +++ b/test/test_encryption.py @@ -326,7 +326,7 @@ def test_multi_key(runner, yadm_cmd, gnupg): # specify two encryption recipient os.system(' '.join(yadm_cmd( - 'config', 'yadm.gpg-recipient', f'"{KEY_NAME} second-key"'))) + 'config', 'yadm.gpg-recipient', f'"second-key {KEY_NAME}"'))) env = os.environ.copy() env['GNUPGHOME'] = gnupg.home diff --git a/yadm b/yadm index f07a649..21d4d7c 100755 --- a/yadm +++ b/yadm @@ -865,7 +865,10 @@ function _set_gpg_options() { if [ "$gpg_key" = "ASK" ]; then GPG_OPTS=("--no-default-recipient" "-e") elif [ "$gpg_key" != "" ]; then - GPG_OPTS=("-e" "-r $gpg_key") + GPG_OPTS=("-e") + for key in $gpg_key; do + GPG_OPTS+=("-r $key") + done else GPG_OPTS=("-c") fi