The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/2882
This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.
=== Description (from pull-request) ===
Hi everyone,
I found that `gpg` ignores the `http_proxy` environment variable. As the lxc-download script already adjusts the keyserver when `http_proxy` is set, it also should set the necessary `gpg` option. Currently there is no way to use lxc-download behind a proxy, because of this problem.
I had to put the `gpg` command in a subshell, because if not, `gpg` would not work properly, as it does not treat `${DOWNLOAD_GPG_PROXY}` as a valid argument.
If there is a better solution, let me know about it. This is my first pull request for this project, I hope I got everything right.
Cheers,
Marco
From 89e781d463cfb08c48611be133d657f562606cc1 Mon Sep 17 00:00:00 2001
From: Marco Dickert <[email protected]>
Date: Wed, 27 Feb 2019 10:58:54 +0100
Subject: [PATCH 1/2] gpg: use proxy, if proxy is set
---
templates/lxc-download.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/templates/lxc-download.in b/templates/lxc-download.in
index 973783ba0a..413b85f35b 100644
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
@@ -60,6 +60,7 @@ if [ -z "${DOWNLOAD_KEYSERVER:-}" ]; then
# Deal with GPG over http proxy
if [ -n "${http_proxy:-}" ]; then
DOWNLOAD_KEYSERVER="hkp://p80.pool.sks-keyservers.net:80"
+ DOWNLOAD_GPG_PROXY="--keyserver-options http-proxy=\"${http_proxy}\""
fi
fi
@@ -133,8 +134,8 @@ gpg_setup() {
success=
for _ in $(seq 3); do
- if gpg --keyserver "${DOWNLOAD_KEYSERVER}" \
- --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1; then
+ if $(gpg --keyserver "${DOWNLOAD_KEYSERVER}" ${DOWNLOAD_GPG_PROXY:-} \
+ --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1); then
success=1
break
fi
From 429a63f17191b9b00e38a7b7ff14de28393c62ef Mon Sep 17 00:00:00 2001
From: Marco Dickert <[email protected]>
Date: Wed, 27 Feb 2019 10:58:54 +0100
Subject: [PATCH 2/2] gpg: use proxy, if proxy is set
Signed-off-by: Marco Dickert <[email protected]>
---
templates/lxc-download.in | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/templates/lxc-download.in b/templates/lxc-download.in
index 973783ba0a..413b85f35b 100644
--- a/templates/lxc-download.in
+++ b/templates/lxc-download.in
@@ -60,6 +60,7 @@ if [ -z "${DOWNLOAD_KEYSERVER:-}" ]; then
# Deal with GPG over http proxy
if [ -n "${http_proxy:-}" ]; then
DOWNLOAD_KEYSERVER="hkp://p80.pool.sks-keyservers.net:80"
+ DOWNLOAD_GPG_PROXY="--keyserver-options http-proxy=\"${http_proxy}\""
fi
fi
@@ -133,8 +134,8 @@ gpg_setup() {
success=
for _ in $(seq 3); do
- if gpg --keyserver "${DOWNLOAD_KEYSERVER}" \
- --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1; then
+ if $(gpg --keyserver "${DOWNLOAD_KEYSERVER}" ${DOWNLOAD_GPG_PROXY:-} \
+ --recv-keys "${DOWNLOAD_KEYID}" >/dev/null 2>&1); then
success=1
break
fi
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel