From 801977b40d8500ff68cf5a6facd82f035735076a Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 3 Feb 2020 16:09:04 +0100 Subject: vendor github.com/containers/image/v5@v5.2.0 See release notes: https://github.com/containers/image/releases/tag/v5.2.0 Fixes: #4877 Signed-off-by: Valentin Rothberg --- vendor/github.com/mtrmac/gpgme/unset_agent_info.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 vendor/github.com/mtrmac/gpgme/unset_agent_info.go (limited to 'vendor/github.com/mtrmac/gpgme/unset_agent_info.go') diff --git a/vendor/github.com/mtrmac/gpgme/unset_agent_info.go b/vendor/github.com/mtrmac/gpgme/unset_agent_info.go new file mode 100644 index 000000000..986aca59f --- /dev/null +++ b/vendor/github.com/mtrmac/gpgme/unset_agent_info.go @@ -0,0 +1,18 @@ +// +build !windows + +package gpgme + +// #include +import "C" +import ( + "unsafe" +) + +// This is somewhat of a horrible hack. We need to unset GPG_AGENT_INFO so that gpgme does not pass --use-agent to GPG. +// os.Unsetenv should be enough, but that only calls the underlying C library (which gpgme uses) if cgo is involved +// - and cgo can't be used in tests. So, provide this helper for test initialization. +func unsetenvGPGAgentInfo() { + v := C.CString("GPG_AGENT_INFO") + defer C.free(unsafe.Pointer(v)) + C.unsetenv(v) +} -- cgit v1.2.3-54-g00ecf