linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Doug Ledford <dledford@redhat.com>, Jason Gunthorpe <jgg@mellanox.com>
Cc: RDMA mailing list <linux-rdma@vger.kernel.org>,
	Leon Romanovsky <leonro@mellanox.com>
Subject: [PATCH rdma-core] cbuild: Run gpg with a home directy in the tmpdir
Date: Tue, 24 Sep 2019 10:59:21 +0300	[thread overview]
Message-ID: <20190924075921.15830-1-leon@kernel.org> (raw)

From: Jason Gunthorpe <jgg@mellanox.com>

To avoid interaction with the user's gpg home directory.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 buildlib/cbuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/buildlib/cbuild b/buildlib/cbuild
index c9522841d..742a9e225 100755
--- a/buildlib/cbuild
+++ b/buildlib/cbuild
@@ -221,13 +221,15 @@ class APTEnvironment(Environment):
         # key for the toolchain ppa.  Fetch it in the host and just import the
         # gpg data directly into the trusted keyring.
         kb = os.path.join(tmpdir,"%s.kb.gpg"%(keyid));
-        subprocess.check_call(["gpg","--no-default-keyring","--keyring",kb,"--always-trust",
-                               "--recv-key",keyid]);
+        env = {k:v for k,v in os.environ.items()};
+        env["HOME"] = tmpdir;
+        subprocess.check_call(["gpg","--keyserver", "keyserver.ubuntu.com", "--no-default-keyring","--keyring",kb,"--always-trust",
+                               "--recv-key",keyid],env=env);
         kr = os.path.join(gpgd,"%s.gpg"%(keyid));
         with open(kr,"wb") as F:
             F.write(subprocess.check_output(["gpg","--no-default-keyring",
                                              "--keyring",kb,
-                                             "--export",keyid]));
+                                             "--export",keyid],env=env));
         os.unlink(kb);
 
         self.add_source_list(tmpdir,keyid + ".list",srcline);
-- 
2.20.1


                 reply	other threads:[~2019-09-24  7:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190924075921.15830-1-leon@kernel.org \
    --to=leon@kernel.org \
    --cc=dledford@redhat.com \
    --cc=jgg@mellanox.com \
    --cc=leonro@mellanox.com \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).