From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id gsZqLBZywV6JDAAA0tVLHw (envelope-from ) for ; Sun, 17 May 2020 17:19:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SP3JJxZywV4oBgAAB5/wlQ (envelope-from ) for ; Sun, 17 May 2020 17:19:18 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 68B0D940429 for ; Sun, 17 May 2020 17:19:18 +0000 (UTC) Received: from localhost ([::1]:40672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jaMwX-0008GK-6L for larch@yhetil.org; Sun, 17 May 2020 13:19:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jaMwK-0008F2-Ul for guix-patches@gnu.org; Sun, 17 May 2020 13:19:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jaMwK-0004Lm-Lh for guix-patches@gnu.org; Sun, 17 May 2020 13:19:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jaMwI-00079e-KW for guix-patches@gnu.org; Sun, 17 May 2020 13:19:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#40601] [PATCH 08/28] guix-install.sh: Use getent for both user & group presence checking. Resent-From: Vincent Legoll Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 May 2020 17:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40601 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 40601@debbugs.gnu.org Cc: Vincent Legoll Received: via spool by 40601-submit@debbugs.gnu.org id=B40601.158973588827249 (code B ref 40601); Sun, 17 May 2020 17:19:02 +0000 Received: (at 40601) by debbugs.gnu.org; 17 May 2020 17:18:08 +0000 Received: from localhost ([127.0.0.1]:44576 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMvP-00075Q-MG for submit@debbugs.gnu.org; Sun, 17 May 2020 13:18:07 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:35887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jaMvC-00071K-G0 for 40601@debbugs.gnu.org; Sun, 17 May 2020 13:17:54 -0400 Received: by mail-wm1-f51.google.com with SMTP id u188so7756015wmu.1 for <40601@debbugs.gnu.org>; Sun, 17 May 2020 10:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0G9W/TT/cnOdqEzDp8jxk8cyBTHuyph0EULP52acRck=; b=EhaRD1Wfk5m4PyEzMS29brIb3OKASeJkJa6ZOPDFrxBTAfkkeCugeQHMC7BHYZvdk3 Ul8T4jH+mkG3BPSbim9Q71rb2AhLuHcAe6OMWnXVfDvVJxma3v5nRBh6q+mMhoOlfIS5 TeMqkLATETF3Qc1LdtQaRE1jeRb2+WChR0Zrb9YwJ7JbOWp5TROwgQezb7BT0Gu+YJSa UqpEy6LdFhTMv/FrGBnND1VakvWSgGebPZ18+rmXL1fn20pBZthUuhjgbwc6uG6nz1p0 0n5Zj5rEN3Mrnt+dhdbJI1sZyJRORHVgxIU1vMcFXXzlMe9o76TxfDPd976HQGoPwL22 W4Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0G9W/TT/cnOdqEzDp8jxk8cyBTHuyph0EULP52acRck=; b=HFI7/PQ2lwhizr9duzZLIGjSkZh+A0NfWddqtgEIuGfFv5V559DSTPZohxS2ZsJmp9 dggP88JHNCSf0UE5hqy9txJDRbO1KIH4ZxQFbI91JmRj4wkSDgLaoR+GBVe4eW3wGYGg xO3bDlhXGuHPqM3YAtym5mIGfPyhtD2K3UghmFHwPj9cnLZnFRjZ5DSNLKam3QqW2UBI u/AomEyZ+lqe0F8WAcRixtA92zB0va+ShehXTMC7ht61f51GyK6a1bZKhmNz0/eiPMRw RlVEfU0TASsscMwwTuUWiMzDnRenq/73kNaEFqhCGjH5/zDossC2tOgjMqe/eVNePSBH ZvHw== X-Gm-Message-State: AOAM532hjksU868B1magQ1dTZCSV4c6lavKCfaYEPco3OIDK7r0rJuVu qf1hqWwAoNVj1gGeGsy+Jt35lk9z X-Google-Smtp-Source: ABdhPJyrdwf071sp6gLrimvJKfJUGyUe08h4w1gPgbgu9n47HMQpwJCwK8SphbBNnxu2Pdw0jKSn8A== X-Received: by 2002:a05:600c:2109:: with SMTP id u9mr14469226wml.75.1589735868765; Sun, 17 May 2020 10:17:48 -0700 (PDT) Received: from localhost.localdomain (se167-1-82-242-148-1.fbx.proxad.net. [82.242.148.1]) by smtp.gmail.com with ESMTPSA id v126sm13305048wma.9.2020.05.17.10.17.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 May 2020 10:17:48 -0700 (PDT) From: Vincent Legoll Date: Sun, 17 May 2020 19:17:05 +0200 Message-Id: <20200517171725.732-8-vincent.legoll@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200517171725.732-1-vincent.legoll@gmail.com> References: <20200517171725.732-1-vincent.legoll@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=EhaRD1Wf; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 4.09 X-TUID: d9GNd9g3IOB5 * etc/guix-install.sh (sys_create_build_user): Use getent instead of id to check presence of users, use bare getent call with output redirection for group check. --- etc/guix-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index 225cf532b8..a56e0ec7b2 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -303,7 +303,7 @@ sys_create_build_user() _debug "--- [ $FUNCNAME ] ---" - if [ $(getent group guixbuild) ]; then + if getent group guixbuild >/dev/null 2>&1; then _msg "${INF}group guixbuild exists" else groupadd --system guixbuild @@ -311,7 +311,7 @@ sys_create_build_user() fi for i in $(seq -w 1 10); do - if id "guixbuilder${i}" &>/dev/null; then + if getent passwd "guixbuilder${i}" >/dev/null 2>&1; then _msg "${INF}user is already in the system, reset" usermod -g guixbuild -G guixbuild \ -d /var/empty -s "$(which nologin)" \ -- 2.26.2