From unknown Thu Aug 21 14:54:27 2025 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-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 From unknown Thu Aug 21 14:54:27 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#48986] [PATCH] gnu: opendoas: Fix restricted path "safepath". Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 16 Jun 2021 20:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48986 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Brice Waegeneire Cc: 48986@debbugs.gnu.org Received: via spool by 48986-submit@debbugs.gnu.org id=B48986.162387681716705 (code B ref 48986); Wed, 16 Jun 2021 20:54:01 +0000 Received: (at 48986) by debbugs.gnu.org; 16 Jun 2021 20:53:37 +0000 Received: from localhost ([127.0.0.1]:53421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltcXZ-0004LM-6m for submit@debbugs.gnu.org; Wed, 16 Jun 2021 16:53:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltcXX-0004L5-NM for 48986@debbugs.gnu.org; Wed, 16 Jun 2021 16:53:36 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33746) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltcXR-0006Tq-Kd; Wed, 16 Jun 2021 16:53:29 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36626 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltcXR-0000MD-Co; Wed, 16 Jun 2021 16:53:29 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210612212442.13395-1-brice@waegenei.re> Date: Wed, 16 Jun 2021 22:53:28 +0200 In-Reply-To: <20210612212442.13395-1-brice@waegenei.re> (Brice Waegeneire's message of "Sat, 12 Jun 2021 23:24:42 +0200") Message-ID: <877ditpm47.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi Brice, Brice Waegeneire skribis: > OpenDoas look for binaries in safepath when a rule specify a relative > command, such as =E2=80=9Cpermit keepenv :wheel cmd guix=E2=80=9D. > > * gnu/packages/admin.scm (opendoas)[phases]: Rename 'fix-install' phase > to 'pre-configure', run it before 'configure' and add a substitution for > safepath. You could maybe move the comment above to admin.scm, right above (substitute* "doas.c" =E2=80=A6). Otherwise LGTM, thanks! Ludo=E2=80=99. From unknown Thu Aug 21 14:54:27 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Brice Waegeneire Subject: bug#48986: closed (Re: bug#48986: [PATCH] gnu: opendoas: Fix restricted path "safepath".) Message-ID: References: <874kdty18o.fsf_-_@waegenei.re> <20210612212442.13395-1-brice@waegenei.re> X-Gnu-PR-Message: they-closed 48986 X-Gnu-PR-Package: guix-patches X-Gnu-PR-Keywords: patch Reply-To: 48986@debbugs.gnu.org Date: Sat, 19 Jun 2021 21:49:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1624139342-21254-1" This is a multi-part message in MIME format... ------------=_1624139342-21254-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #48986: [PATCH] gnu: opendoas: Fix restricted path "safepath". which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 48986@debbugs.gnu.org. --=20 48986: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D48986 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1624139342-21254-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 48986-done) by debbugs.gnu.org; 19 Jun 2021 21:48:51 +0000 Received: from localhost ([127.0.0.1]:60914 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luipf-0005WN-9s for submit@debbugs.gnu.org; Sat, 19 Jun 2021 17:48:51 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:22487) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luipd-0005W6-8F for 48986-done@debbugs.gnu.org; Sat, 19 Jun 2021 17:48:49 -0400 Received: (Authenticated sender: brice@waegenei.re) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 13BD8240003; Sat, 19 Jun 2021 21:48:42 +0000 (UTC) From: Brice Waegeneire To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#48986: [PATCH] gnu: opendoas: Fix restricted path "safepath". References: <20210612212442.13395-1-brice@waegenei.re> <877ditpm47.fsf@gnu.org> Date: Sat, 19 Jun 2021 23:48:39 +0200 In-Reply-To: <877ditpm47.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 16 Jun 2021 22:53:28 +0200") Message-ID: <874kdty18o.fsf_-_@waegenei.re> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 48986-done Cc: 48986-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Ludo=E2=80=99, Thank you for the review. Ludovic Court=C3=A8s writes: > Hi Brice, > > Brice Waegeneire skribis: > >> OpenDoas look for binaries in safepath when a rule specify a relative >> command, such as =E2=80=9Cpermit keepenv :wheel cmd guix=E2=80=9D. >> >> * gnu/packages/admin.scm (opendoas)[phases]: Rename 'fix-install' phase >> to 'pre-configure', run it before 'configure' and add a substitution for >> safepath. > > You could maybe move the comment above to admin.scm, right above > (substitute* "doas.c" =E2=80=A6). Done. > Otherwise LGTM, thanks! Pushed as eb939109b9c06a09e1534a403745bd362b653d95. Cheers, - Brice ------------=_1624139342-21254-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 To: guix-patches@gnu.org Subject: [PATCH] gnu: opendoas: Fix restricted path "safepath". 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-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) 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 ------------=_1624139342-21254-1--