From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CAMyJ1BHimJZuQAAbAwnHQ (envelope-from ) for ; Sun, 22 May 2022 16:23:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id sMM9JlBHimLeCQEAG6o9tA (envelope-from ) for ; Sun, 22 May 2022 16:23:12 +0200 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 3987F9492 for ; Sun, 22 May 2022 16:23:12 +0200 (CEST) Received: from localhost ([::1]:58200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nsmUB-00058M-1p for larch@yhetil.org; Sun, 22 May 2022 10:23:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsmU2-000588-Ae for guix-patches@gnu.org; Sun, 22 May 2022 10:23:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52212) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nsmU2-0004eh-2W for guix-patches@gnu.org; Sun, 22 May 2022 10:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nsmU1-0008Eu-Ol for guix-patches@gnu.org; Sun, 22 May 2022 10:23:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55577] [PATCH] Check substitute --help or --version options early Resent-From: yarl-baudig@mailoo.org Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 22 May 2022 14:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55577 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55577@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165322935531632 (code B ref -1); Sun, 22 May 2022 14:23:01 +0000 Received: (at submit) by debbugs.gnu.org; 22 May 2022 14:22:35 +0000 Received: from localhost ([127.0.0.1]:46109 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsmTZ-0008E6-E6 for submit@debbugs.gnu.org; Sun, 22 May 2022 10:22:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:48634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nsm2k-00072P-4B for submit@debbugs.gnu.org; Sun, 22 May 2022 09:54:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsm2j-0003k8-SX for guix-patches@gnu.org; Sun, 22 May 2022 09:54:49 -0400 Received: from msg-1.mailo.com ([213.182.54.11]:60282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nsm2h-0000bK-Af for guix-patches@gnu.org; Sun, 22 May 2022 09:54:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailoo.org; s=mailo; t=1653227682; bh=kZlhmz2mrVMmu0n1r5XDX/M/8sWpUwu3O9YtblxgQb4=; h=X-EA-Auth:From:To:Date:Subject:MIME-Version:X-Mailer:Message-ID: Content-Type:Content-Transfer-Encoding; b=U4ZGy/CrTIHOTzvgrnvL1ZKWEjc3kUR+8NaWPrqWxeQBoDeDJKvDInLQ4a56ZKuIB li8T0e5+g+JB3xaGfjMwZPlD9vlBiM2jLR5pJsa2p74nwXrLmrCK1Hp4QztS2IUUru iI0kJ2bzasEV6o+jnxrdo3A6uIZgG7vIDXCestRw= Received: by www-7.mailo.com with http webmail; Sun, 22 May 2022 15:54:42 +0200 (CEST) X-EA-Auth: MFdw7ab51SW+aSaw1OCN3yMzwJdv2/lPYU4hKopUPGYLWIkcb2z3/Sy1gkGVXj0TIcnpTFwVW/9z0DieV4t4FNjOq1nG87gW From: yarl-baudig@mailoo.org Date: Sun, 22 May 2022 15:54:42 +0200 (CEST) X-Priority: 3 MIME-Version: 1.0 X-Mailer: COMS/EA21.01/r20220415 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=213.182.54.11; envelope-from=yarl-baudig@mailoo.org; helo=msg-1.mailo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 22 May 2022 10:22:32 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653229392; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=8Q6eNZfacLqNGN9x41b6hIZIoXzxC9YSlHq+kiSgDJk=; b=i5wFvLijIi/tizneKcOAy8Z4RTIu5zk8D0SOB9UuA9BFig3kpooAHR5C+CXnumPrjfButd XEmKRs6DczzGiasYxuEfepV3aKa4ahyINyGFtPp1a1tI2Kxk3i7sGT96g+eItCGtQcA8Cy tKK3XEgPcKI1kMXj40IhFWJkzFPBGZYhxDAJEQscvMlAApNrGjXHQ1/B64csbPwoIAkynt /m82vLOUAlcPPAZCzQy5lamqChPXOtfdOVOHFAjdbMlVQeEL0cTbtqJYvmWi81Owz6odaJ 7dYuzOxfkjrdCBNOcg+n1Shh4VRG46s4FrPDlzCNoQFr2P5ffptT+OZHYzZBNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653229392; a=rsa-sha256; cv=none; b=mQoZuXoLb3GUDp2HkRyAf7OPfnmIH4Y1j+UoVEsi0gLixtqxnYcY8EQ2bUVmZc2MdPqoUa O+rnn1dedaPEKNGLGgMaIJocXL4KKLmZBBkEYF5N16irgpBNEZl/iZwNs16kULV5UDSNfz tWbL/zKR70/Z9EVb8OmmOcUcwvUQEfPQ27fYlSrf3yeAHYoVlP3w1p+orhzqthlB+DEvfO 7gtvl0cWawolMD8yfGUGMrZIwW/Qtl7cs0Unp4d0Y2+9pxeKTRi8bZ8nwqDTByBbuoUvkf SLONChvVztqVCC1M+BMsvbh743t0IXeH9U2qtf4yNL9pPFld2vfHTu+f0SXXsA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b="U4ZGy/Cr"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 6.15 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailoo.org header.s=mailo header.b="U4ZGy/Cr"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailoo.org (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3987F9492 X-Spam-Score: 6.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: g7Ip60m0SA1k Running `guix archive --authorize` sets /etc/guix/acl to 600 via with-atomic-file-output via mkstemp!. Then running `guix substitute --help/--version` fails on "permission denie= d". While "guix substitute" is an internal tool, the options --help and --vers= ion exist and you should be able to run those from the command line. * guix/scripts/substitute.scm: earlier check for --help or --version. --- guix/scripts/substitute.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 908a8334a8..c5f5d23b47 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -704,6 +704,14 @@ (define-command (guix-substitute . args) (category internal) (synopsis "implement the build daemon's substituter protocol") =20 + (match args + ((or ("-V") ("--version")) + (show-version-and-exit "guix substitute")) + ((or ("-h") ("--help") ()) + (show-help) + (exit 0)) + (_ #t)) + (define print-build-trace? (match (or (find-daemon-option "untrusted-print-extended-build-trace"= ) (find-daemon-option "print-extended-build-trace")) @@ -775,10 +783,6 @@ (define reply-port #:print-build-trace? print-build-trace?) (loop)))))) - ((or ("-V") ("--version")) - (show-version-and-exit "guix substitute")) - ((or ("-h") ("--help")) - (show-help)) (opts (leave (G_ "~a: unrecognized options~%") opts)))))) =20 --=20 2.36.0