public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Anton Mikanovich <anton.mikanovich@promwad.com>
To: isar-users@googlegroups.com
Cc: Anton Mikanovich <amikan@ilbers.de>
Subject: [PATCH] isar-bootstrap: Remove GNUPGHOME sharing
Date: Thu, 14 Oct 2021 17:44:43 +0300	[thread overview]
Message-ID: <1634222683-29000-1-git-send-email-anton.mikanovich@promwad.com> (raw)

From: Anton Mikanovich <amikan@ilbers.de>

Run every gpg-agent in separate GNUPGHOME to get rid of any conflicts
in case of multiple keys defined in THIRD_PARTY_APT_KEYS.

Fix issue #73

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index b8af6760..08b1486b 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -331,23 +331,22 @@ do_bootstrap() {
         mkdir -p "${ROOTFSDIR}/etc/apt/apt.conf.d"
         install -v -m644 "${WORKDIR}/isar-apt.conf" \
                          "${ROOTFSDIR}/etc/apt/apt.conf.d/50isar.conf"
-        if [ -n "${@get_distro_needs_gpg_support(d)}" ]; then
+        find ${APT_KEYS_DIR}/ -type f | while read keyfile
+        do
             MY_GPGHOME="$(chroot "${ROOTFSDIR}" mktemp -d /tmp/gpghomeXXXXXXXXXX)"
             echo "Created temporary directory ${MY_GPGHOME} for gpg-agent"
             export GNUPGHOME="${MY_GPGHOME}"
             APT_KEY_APPEND="--homedir ${MY_GPGHOME}"
-        fi
-        find ${APT_KEYS_DIR}/ -type f | while read keyfile
-        do
+
             kfn="$(basename $keyfile)"
             cp $keyfile "${ROOTFSDIR}/tmp/$kfn"
             chroot "${ROOTFSDIR}" /usr/bin/gpg-agent --daemon -- /usr/bin/apt-key \
                 --keyring ${THIRD_PARTY_APT_KEYRING} ${APT_KEY_APPEND} add "/tmp/$kfn"
             rm "${ROOTFSDIR}/tmp/$kfn"
-        done
-        if [ -n "${MY_GPGHOME}" ]; then
+
+            echo "Removing ${MY_GPGHOME}"
             rm -rf "${ROOTFSDIR}${MY_GPGHOME}"
-        fi
+        done
 
         if [ "${@get_distro_suite(d)}" = "stretch" ] && [ "${@get_host_release().split('.')[0]}" -lt "4" ]; then
             install -v -m644 "${WORKDIR}/isar-apt-fallback.conf" \
-- 
2.20.1


             reply	other threads:[~2021-10-14 14:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 14:44 Anton Mikanovich [this message]
2021-10-22 14:59 ` Anton Mikanovich

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=1634222683-29000-1-git-send-email-anton.mikanovich@promwad.com \
    --to=anton.mikanovich@promwad.com \
    --cc=amikan@ilbers.de \
    --cc=isar-users@googlegroups.com \
    /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