From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6626616999001718784 X-Received: by 2002:a1c:b105:: with SMTP id a5-v6mr2130651wmf.3.1542968664795; Fri, 23 Nov 2018 02:24:24 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:32c4:: with SMTP id y187-v6ls3135823wmy.11.gmail; Fri, 23 Nov 2018 02:24:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/W1izX7dDuce7OMQ3bSwSKZ7p3AbpQn7fgNPsndTLoLtw2YFrsxpWXvBdGqaZ77zjIKuBC6 X-Received: by 2002:a1c:2d12:: with SMTP id t18mr1972764wmt.9.1542968664427; Fri, 23 Nov 2018 02:24:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542968664; cv=none; d=google.com; s=arc-20160816; b=Cd3GVvoV5NVZStpP07WeH+ql6EVYylhXP+Z6DEDgAydeBQqeIBNH6wrpoHf++pryBo iRWfwtWuBS9TeLXmpPo0wjhFRFK5ts/3k+Zf4mF1gjpbJlULCi7xRrGH6wN8xz8HSVvl IoT2Qsy1gf1ZZGuttNVq55tu4umF6KRKM3S0auRrf1isbbv8w6OVjZsI2JQCvsnoxwz4 1vfpSerlCEHshgATnceFYUcb6lNI1F9L2OA6ftmFiIoQEPJVEw17YrEGo0nxysrpI7DW 5HxBNNLEX5zq1rAwAAO1YRJZ4/WFZnEi82u7EMNySJ2dgWMyTU7ZsMLxr2h6I858weOb dsTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:to:subject; bh=1+dZa8WruHSuZw6kAI473rKfxXZg+GRrAXLe9rlon7s=; b=O78LfPvP11cyNqwwoYDZQxA+rCiFLF1RYmEbeX/iZOIoHInDdlUNxfkYes5WK64OIK z99vjKE2vOdA5BGQI8QMc44zmXbF1GJ+H70unZulDhEm0CTJ//PPLkbU7nBCnDqUAz+q u/0Bunx34gB430xN05/HNSWeqY1JR0alS/2zY/1jCfDgI0TeUeZT8nHM7njzQ4C34Tyq LB7EzE6eKI6oFmPReZZc3T+UdFyTHHFeyTsHbl1BY2JBDb4fGYHjnqTYzuwjnqSI+V6s ZfunyVPb38wqK5EhypYmToL8NIm+XvtEN8JQL7oOgnkHme0qZK1PV3XyE4a54MpVh+bP 236Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id x13si517337wrn.3.2018.11.23.02.24.24 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Nov 2018 02:24:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from [192.168.50.180] (nat-ppp-217.71.235.199-satnet-spb.ru [217.71.235.199] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id wANAOLpQ025150 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Fri, 23 Nov 2018 11:24:23 +0100 Subject: Re: [PATCH 2/2] buildchroot: Assert that we are one of the two valid users To: Henning Schild , isar-users@googlegroups.com References: <20181122093818.21909-1-henning.schild@siemens.com> <20181122093818.21909-2-henning.schild@siemens.com> From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: <33e0351e-889f-3bd5-a67d-7d036e863c2e@ilbers.de> Date: Fri, 23 Nov 2018 13:24:16 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <20181122093818.21909-2-henning.schild@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: eA2rKcjFWpgn On 11/22/18 12:38 PM, Henning Schild wrote: > 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. Applied to the 'next', Thanks, Maxim. > Signed-off-by: Henning Schild > --- > 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 > > -- Maxim Osipov ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn Germany +49 (151) 6517 6917 mosipov@ilbers.de http://ilbers.de/ Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov