From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4NbQFz4mxWCB5QAAgWs5BA (envelope-from ) for ; Sat, 12 Jun 2021 23:25:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yDvLEj4mxWCaPAAAbx9fmQ (envelope-from ) for ; Sat, 12 Jun 2021 21:25: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 1A4E82DD85 for ; Sat, 12 Jun 2021 23:25:18 +0200 (CEST) Received: from localhost ([::1]:57998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsB81-0005rh-6u for larch@yhetil.org; Sat, 12 Jun 2021 17:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34474) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsB7o-0005JE-Dl for guix-patches@gnu.org; Sat, 12 Jun 2021 17:25:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58938) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsB7o-0002NZ-5Y for guix-patches@gnu.org; Sat, 12 Jun 2021 17:25:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsB7o-0008Rd-3X for guix-patches@gnu.org; Sat, 12 Jun 2021 17:25:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48986] [PATCH] gnu: opendoas: Fix restricted path "safepath". Resent-From: Brice Waegeneire Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 12 Jun 2021 21:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48986 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48986@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162353309032370 (code B ref -1); Sat, 12 Jun 2021 21:25:03 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jun 2021 21:24:50 +0000 Received: from localhost ([127.0.0.1]:42240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsB7Z-0008Q2-O7 for submit@debbugs.gnu.org; Sat, 12 Jun 2021 17:24:49 -0400 Received: from lists.gnu.org ([209.51.188.17]:44668) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsB7X-0008Pu-VP for submit@debbugs.gnu.org; Sat, 12 Jun 2021 17:24:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsB7X-0005GI-Ox for guix-patches@gnu.org; Sat, 12 Jun 2021 17:24:47 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:60075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsB7V-0002BA-VE for guix-patches@gnu.org; Sat, 12 Jun 2021 17:24:47 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id C0AB8C0005 for ; Sat, 12 Jun 2021 21:24:43 +0000 (UTC) From: Brice Waegeneire Date: Sat, 12 Jun 2021 23:24:42 +0200 Message-Id: <20210612212442.13395-1-brice@waegenei.re> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.70.183.198; envelope-from=brice@waegenei.re; helo=relay6-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1623533118; 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; bh=UxS3dou+RqGRDKsz0b/O70kiZoWgvWmPw5iYyrL0d/4=; b=qdIWVUICqNbaeOziG5DQNb1qs3OlLZVSnMKgBXTJfuCuYgvqy22B7u3PsH3+ZmCu9tTNY0 k40DOBMbEtmHebQjhvY8dC5AV5SpeJv0X2egtqhcsgwvqZP16MLXC8jRpkis0MkUVBnIYw 9bpfM2b7WW8QNEnduuudQyVrbgzb0nPkzLRfbY3UeGzOTpbiqRbdCuoacp8D5Stck8hV/H qCoOH0tiB8CAxC4mmc2RW25/fvsr281vnubeQ8lFrDE6ny2MZgDuLLwHFsRDqiRcyrr2mg yd6xjfCFWoxRkCabuRa4Qf45vjyzcWVv9XE5PsqOvYFExhr/kSJGzHMCuyGR1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623533118; a=rsa-sha256; cv=none; b=F212OKfuCbIq/Bsk9aNwkVB6y37a/sjMyhY7sc0YlJq0ybNYyaj2qoTUDDOMq0pnKH7QwM C9kyuy9qgsS2HFfWeD46AcUwXaBJbl8qngMdOJomEHv04XijIygDx7WFiwTNxIUWU67g7s QvYPZvx5UeemSTq9BfpsAl/NXZW6u3KXlxxFnUICWpmpT08CRNQDGDFInhAPVQXHEtm6gw 3zKuqQ/DY26svbe3uz8ntiU01KzyQHhXF+rAdTaDppVZuT8Bh47sQSDLB+F614tPpVTZ9B OlBVVv3eIvzW93x5Fwh0XPImEGXZGAdWQZfmDR2IQm+G2Rv+G1eyI1M3oQB0Ng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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-Migadu-Spam-Score: 0.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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-Migadu-Queue-Id: 1A4E82DD85 X-Spam-Score: 0.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3GqgtZt4RLNW OpenDoas look for binaries in safepath when a rule specify a relative command, such as “permit keepenv :wheel cmd guix”. * gnu/packages/admin.scm (opendoas)[phases]: Rename 'fix-install' phase to 'pre-configure', run it before 'configure' and add a substitution for safepath. --- gnu/packages/admin.scm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 12eb659039..80d12fc2a3 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -41,6 +41,7 @@ ;;; Copyright © 2021 Hyunseok Kim ;;; Copyright © 2021 David Larsson ;;; Copyright © 2021 WinterHound +;;; Copyright © 2021 Brice Waegeneire ;;; ;;; This file is part of GNU Guix. ;;; @@ -1699,18 +1700,25 @@ commands and their arguments.") (arguments `(#:phases (modify-phases %standard-phases + (add-before 'configure 'pre-configure + (lambda* (#:key outputs #:allow-other-keys) + (substitute* "GNUmakefile" + (("^\tchown.*$") "")) + (substitute* "doas.c" + (("safepath =" match) + (string-append match " \"" + "/run/setuid-programs:" + "/run/current-system/profile/bin:" + "/run/current-system/profile/sbin:" + "\" "))) + #t)) (replace 'configure ;; The configure script doesn't accept most of the default flags. (lambda* (#:key configure-flags #:allow-other-keys) ;; The configure script can be told which compiler to use only ;; through environment variables. (setenv "CC" ,(cc-for-target)) - (apply invoke "./configure" configure-flags))) - (add-before 'install 'fix-makefile - (lambda* (#:key outputs #:allow-other-keys) - (substitute* "GNUmakefile" - (("^\tchown.*$") "")) - #t))) + (apply invoke "./configure" configure-flags)))) #:configure-flags (list (string-append "--prefix=" (assoc-ref %outputs "out")) "--with-timestamp") -- 2.31.1