From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6654500580778573824 X-Received: by 2002:a7b:c207:: with SMTP id x7mr5460wmi.5.1549391664635; Tue, 05 Feb 2019 10:34:24 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:f350:: with SMTP id e16ls869532wrp.2.gmail; Tue, 05 Feb 2019 10:34:23 -0800 (PST) X-Google-Smtp-Source: AHgI3IZUpKI2yr3WVJlSb6jisiOyZvvJBmO/OduK9P9tYnelkwdcKAugr8X/3+r1OJDVkSdxeD8q X-Received: by 2002:adf:c103:: with SMTP id r3mr388859wre.20.1549391663654; Tue, 05 Feb 2019 10:34:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549391663; cv=none; d=google.com; s=arc-20160816; b=RcdKZDEP2+rXT5xrlza9DQBgTVm0uhYOoonBHR2bJx2vQTGuJrNNXp0nGqwfDkKNpl VT4LYaLyn5MowK6yDdJUE4t+buhOieheDa5FJl8rHa3vmHhejHZxlYCPiKIaJntNdZFt 0GVgQjt5Cb2LhwF1y7RJhWcQPxU5jZOPZezA69i8vzC1V6MIEw0j8SiLqA5+Y23Hb8X8 uGWQ7ZZ57rR8UsB/IJ4m9w9vyOJTDsxdD8HILUNFBFKK/vMgXxCf6JQdsG6l/LAAWpBa zMTLQR89GWtHaWm8IDvtwRp6l//NbIlOH2yZMb6czy1/lMiP9R+A3aSasBOGOBicW7UN Y8Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=cYdg/MPxBvHjmqrT7qctxqWsAF10ygBQY10qR7QyzJU=; b=zfV1eH3e1hSUT2GytJsUhtqB3lhBLxXITwIY5JyQZpF+kV8px/KHqUOt2T9pJggjI8 46vSkVwxi1nUqw5qokMvwi3RndPozgDucgejb4nPK/wgDZZ287H424VJKSkWtVryXaTO u33nDpGuBDta3FYCWfDn4bgU++jXPImgeW8qS+LgNYGSUrWoNXgAGR4n2OE+JgtR1LMu p0DalbLOv+BFzTP7mjgokC+Uh2lB63tbTedPOoTASyYZVOmdJbFNux+U4FtbGDLYD4Nx fw29/Ys4vosmsbVNp4usoppj9D8yA1GHffTuFalZD79CScIovNP70EYjDBYrGE6SZ7e9 omhg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id y200si612988wmd.0.2019.02.05.10.34.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 10:34:23 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id x15IYMed022431 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Feb 2019 19:34:23 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.0.7]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x15IYLI3025346; Tue, 5 Feb 2019 19:34:22 +0100 Date: Tue, 5 Feb 2019 19:34:19 +0100 From: Henning Schild To: Harald Seiler Cc: Subject: Re: [PATCH 2/2] buildchroot: Fix not checking group Message-ID: <20190205193419.105748a5@md1za8fc.ad001.siemens.net> In-Reply-To: <20190205130004.15200-3-hws@denx.de> References: <20190205130004.15200-1-hws@denx.de> <20190205130004.15200-3-hws@denx.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: f7ZM9ij8LR8H Am Tue, 5 Feb 2019 14:00:04 +0100 schrieb Harald Seiler : > The previous code checked the username twice instead of the user > AND group-names. This patch changes the check to behave correctly > and also adds a more comprehensive error message. > > Signed-off-by: Harald Seiler > --- > meta/recipes-devtools/buildchroot/files/common.sh | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/meta/recipes-devtools/buildchroot/files/common.sh > b/meta/recipes-devtools/buildchroot/files/common.sh index > 8caa4f4..9e6adbc 100644 --- > a/meta/recipes-devtools/buildchroot/files/common.sh +++ > b/meta/recipes-devtools/buildchroot/files/common.sh @@ -8,7 +8,12 @@ > 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" ] +if ([ "$(id -un)" != > "builder" ] || [ "$(id -gn)" != "builder" ]) && Good catch! Sometimes you just have to double check ... ;) Henning > + ([ "$(id -un)" != "root" ] || [ "$(id -gn)" != "root" ]); > then > + echo "This script can only be run as root:root or > builder:builder!" >&2 > + echo "(Currently running as $(id -un)($(id -u)):$(id -gn)($(id > -g)))" >&2 > + exit 1 > +fi > > # Create human-readable names > target_arch=$2