public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 2/2] buildchroot: Assert that we are one of the two valid users
Date: Thu, 22 Nov 2018 10:38:18 +0100	[thread overview]
Message-ID: <20181122093818.21909-2-henning.schild@siemens.com> (raw)
In-Reply-To: <20181122093818.21909-1-henning.schild@siemens.com>

Everything we do inside the buildchroot should be done as "root:root" or
"builder:builder" and we depend on "builder:builder" being in sync with
the ids in the system we chroot from.

This assertion will find violations or the odd case where the ids got
out of sync.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/recipes-devtools/buildchroot/files/common.sh | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-devtools/buildchroot/files/common.sh b/meta/recipes-devtools/buildchroot/files/common.sh
index ea82bf1..25b0bb6 100644
--- a/meta/recipes-devtools/buildchroot/files/common.sh
+++ b/meta/recipes-devtools/buildchroot/files/common.sh
@@ -7,6 +7,9 @@
 set -e
 printenv | grep -q BB_VERBOSE_LOGS && set -x
 
+# assert we are either "root:root" or "builder:builder"
+[ $( id -un ) = "builder" -a $( id -un ) = "builder" ] || [ $( id -un ) = "root" -a $( id -un ) = "root" ]
+
 # Create human-readable names
 target_arch=$2
 
-- 
2.19.1


  reply	other threads:[~2018-11-22  9:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22  9:38 [PATCH 1/2] buildchroot: Enter buildchroot with right user:group directly Henning Schild
2018-11-22  9:38 ` Henning Schild [this message]
2018-11-23 10:24   ` [PATCH 2/2] buildchroot: Assert that we are one of the two valid users Maxim Yu. Osipov
2018-11-22 10:13 ` [PATCH 1/2] buildchroot: Enter buildchroot with right user:group directly chombourger
2018-11-22 12:03   ` Henning Schild
2018-11-22 13:58 ` Henning Schild
2018-11-23 10:24 ` Maxim Yu. Osipov

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=20181122093818.21909-2-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --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