[Pkg-gnupg-commit] [gpgme] 104/132: tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 26 01:01:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gpgme.

commit 16b202d9999591b71fb8bb49f6db10ef96d4cbe8
Author: Justus Winter <justus at g10code.com>
Date:   Mon Mar 20 16:36:27 2017 +0100

    tests: Use 'gpg-agent --allow-loopback-pinentry' if applicable.
    
    * lang/python/tests/Makefile.am (gpg-agent.conf): Do not hard-code the
    option.  This breaks gpg-agent from GnuPG 2.0.
    * tests/start-stop-agent: Rather, check if the option is supported and
    add it to the configuration if it is.
    
    GnuPG-bug-id: 3008
    Fixes-commit: bbf19124bbec9eb6298cef2914baae7ac74382fe
    Signed-off-by: Justus Winter <justus at g10code.com>
---
 lang/python/tests/Makefile.am | 1 -
 tests/start-stop-agent        | 8 ++++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lang/python/tests/Makefile.am b/lang/python/tests/Makefile.am
index 7251cd3..a935222 100644
--- a/lang/python/tests/Makefile.am
+++ b/lang/python/tests/Makefile.am
@@ -117,4 +117,3 @@ clean-local:
 ./gpg-agent.conf:
 # This is required for gpg2, which does not support command fd.
 	echo pinentry-program $(abs_top_srcdir)/tests/gpg/pinentry >$@
-	echo allow-loopback-pinentry >>$@
diff --git a/tests/start-stop-agent b/tests/start-stop-agent
index e843ce5..457f70d 100755
--- a/tests/start-stop-agent
+++ b/tests/start-stop-agent
@@ -38,6 +38,14 @@ fi
 
 echo "starting gpg-agent.." >&2
 
+# GnuPG prior to 2.1.12 needs --allow-loopback-pinentry for the
+# loopback entry to work.  Old versions do not understand this though,
+# so we need to be careful.
+if "$GPG_AGENT" --gpgconf-test --allow-loopback-pinentry &&
+   ! grep -q allow-loopback-pinentry "$GNUPGHOME/gpg-agent.conf"; then
+    echo allow-loopback-pinentry >> "$GNUPGHOME/gpg-agent.conf"
+fi
+
 gpg-connect-agent --agent-program="${GPG_AGENT}|--debug-quick-random" putval\ $token\ set /bye
 if [ $? -ne 0 -o "$(gpg-connect-agent getval\ $token /bye 2>/dev/null | head -1)" \
       != "D set" ]; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list