From a47771964c7051347fa3f1f90f2b21a3fa1b850c Mon Sep 17 00:00:00 2001 From: deajan Date: Mon, 4 May 2020 11:35:16 +0100 Subject: [PATCH] On the gpg 2.1.11 fix route --- dev/n_obackup.sh | 6 +++++- dev/tests/run_tests.sh | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dev/n_obackup.sh b/dev/n_obackup.sh index 64b8c08..b78dc9d 100644 --- a/dev/n_obackup.sh +++ b/dev/n_obackup.sh @@ -1335,7 +1335,11 @@ function DecryptFiles { cryptToolSubVersion=${cryptToolSubVersion%.*} if [ $cryptToolMajorVersion -eq 2 ] && [ $cryptToolSubVersion -ge 1 ]; then - additionalParameters="--pinentry-mode loopback" + if [ $cryptToolMinorVersion -gt 11 ]; then + additionalParameters="--pinentry-mode loopback" + elif [ $cryptToolMinorVersion -eq 11 ]; then + Logger "GPG automatism via --pinentry-mode loopback not supported in gpg version 2.1.11. Please add allow-loopback-pinentry to your gpg-agent.conf file." "NOTICE" + fi fi if [ -f "$passphraseFile" ]; then diff --git a/dev/tests/run_tests.sh b/dev/tests/run_tests.sh index 2e5d9ba..55ef938 100755 --- a/dev/tests/run_tests.sh +++ b/dev/tests/run_tests.sh @@ -349,8 +349,8 @@ function test_GPG () { additionalParameters="--pinentry-mode loopback" elif [ $cryptToolMinorVersion -eq 11 ]; then echo "Using fix to allow --pinentry-mode loopback" - [ -f "{$HOME}/.gnupg/gpg-agent.conf" ] || touch "{$HOME}/.gnupg/gpg-agent.conf" - echo "allow-loopback-pinentry" >> "{$HOME}/.gnupg/gpg-agent.conf" + [ -f "${HOME}/.gnupg/gpg-agent.conf" ] || touch "${HOME}/.gnupg/gpg-agent.conf" + echo "allow-loopback-pinentry" >> "${HOME}/.gnupg/gpg-agent.conf" gpgconf --reload gpg-agent else echo "Not using --pinentry-mode loopback [$cryptToolMajorVersion.$cryptToolSubVersion.$cryptToolMinorVersion]"