From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6654500580778573824 X-Received: by 2002:a2e:9757:: with SMTP id f23-v6mr293013ljj.23.1549371660537; Tue, 05 Feb 2019 05:01:00 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:7b01:: with SMTP id w1ls1990701lfc.9.gmail; Tue, 05 Feb 2019 05:00:59 -0800 (PST) X-Google-Smtp-Source: AHgI3IaFMIl3kDkw4rcK9OVI8bugFlRXWKjMBFpb7PF9mRFV0Njsz4SCgG0BM8kwu9SA9f6Bm7W0 X-Received: by 2002:ac2:4150:: with SMTP id c16mr330350lfi.2.1549371659964; Tue, 05 Feb 2019 05:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549371659; cv=none; d=google.com; s=arc-20160816; b=xEgY4jWyYu/XxnEfefvSSLMPyo1n6Km+24wIwRoc3oKPJsZserMlgZ10Tcjl52niNv twatuvA/aKV3wVBwr+PFTor/Z+Y6PsyXq0lue3CJ8RX3cY7aJUVY/AlEr7H3d8+sBH2I oDmO/a2JHDbVAl+vk1hrw3JD6iHmRAIYa3WEWiCDhdFZwgnRomf7RrGDNJDe9sA0ZBOS 3bSc3nnS8tBBaq08E9WVmsJ+kO3osGT88aIrHgPCsv20crWsHGzIhHSd/bftCm6Y/Gis cOmX7CZTkevVMOwiM2StKlsc/EBWRs8Y/nOCCkKf36toFOMpGhqaktceanAgU/OhzDN5 v0TQ== 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:date:subject:to:from; bh=P3VtHuo6oyjgjZo8onMPqU8aBilhvLE/vWfliS8GdrA=; b=fAC4h3FEmUR1pOe9TvydE2lBYuZ3r96MsUv1bNX6DRgiA9f2WMK8rFGqdLWzgC30H9 O7z34+5AjFP5sY1Gk19h/K0e9rwQ3acktco03mmsTTxIol0yzNHCN3Y9GeU6rGS9fx23 qNQbpHGUDuq8DoWbPoKNv3W2ITMotxLt0b/5lChlkw4FENF3lnV7xhiTzcx9WqsvzVZB wWPMm0g1mf65hvsSpVHUmnv3hEvBleldpfiS26wx8AnyYVjAUDdaxZdcD4W13wOZrcbj r6CsyxgcaiNar7b3Xcnml0vkUkgi9rg9pGMwTOa7ZLBOLkJLJ+2nv/SpRksG3sOPYNLY Oh9A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net. [212.18.0.9]) by gmr-mx.google.com with ESMTPS id t73si387129lfe.4.2019.02.05.05.00.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Feb 2019 05:00:59 -0800 (PST) Received-SPF: neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) client-ip=212.18.0.9; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.18.0.9 is neither permitted nor denied by best guess record for domain of hws@denx.de) smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 43v4Sq33sTz1rRDg for ; Tue, 5 Feb 2019 14:00:59 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 43v4Sq30Qwz1qvWQ for ; Tue, 5 Feb 2019 14:00:59 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id zr-q8oV44Loa for ; Tue, 5 Feb 2019 14:00:58 +0100 (CET) X-Auth-Info: +t7KSIjGus3Am0DIhUbjg4LfIu/b/qN8R6MOTlTQb44= Received: from sandvich.fritz.box (p578a821c.dip0.t-ipconnect.de [87.138.130.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA for ; Tue, 5 Feb 2019 14:00:58 +0100 (CET) From: Harald Seiler To: isar-users@googlegroups.com Subject: [PATCH 2/2] buildchroot: Fix not checking group Date: Tue, 5 Feb 2019 14:00:04 +0100 Message-Id: <20190205130004.15200-3-hws@denx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190205130004.15200-1-hws@denx.de> References: <20190205130004.15200-1-hws@denx.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: A+UG+tP2qJFf 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" ]) && + ([ "$(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 -- 2.14.1