all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#48986] [PATCH] gnu: opendoas: Fix restricted path "safepath".
@ 2021-06-12 21:24 Brice Waegeneire
  2021-06-16 20:53 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Brice Waegeneire @ 2021-06-12 21:24 UTC (permalink / raw)
  To: 48986

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 <lasnesne@lagunposprasihopre.org>
 ;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
 ;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
+;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; 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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#48986] [PATCH] gnu: opendoas: Fix restricted path "safepath".
  2021-06-12 21:24 [bug#48986] [PATCH] gnu: opendoas: Fix restricted path "safepath" Brice Waegeneire
@ 2021-06-16 20:53 ` Ludovic Courtès
  2021-06-19 21:48   ` bug#48986: " Brice Waegeneire
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2021-06-16 20:53 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 48986

Hi Brice,

Brice Waegeneire <brice@waegenei.re> skribis:

> 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.

You could maybe move the comment above to admin.scm, right above
(substitute* "doas.c" …).

Otherwise LGTM, thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#48986: [PATCH] gnu: opendoas: Fix restricted path "safepath".
  2021-06-16 20:53 ` Ludovic Courtès
@ 2021-06-19 21:48   ` Brice Waegeneire
  0 siblings, 0 replies; 3+ messages in thread
From: Brice Waegeneire @ 2021-06-19 21:48 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 48986-done

Ludo’,

Thank you for the review.

Ludovic Courtès <ludo@gnu.org> writes:

> Hi Brice,
>
> Brice Waegeneire <brice@waegenei.re> skribis:
>
>> 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.
>
> You could maybe move the comment above to admin.scm, right above
> (substitute* "doas.c" …).

Done.

> Otherwise LGTM, thanks!

Pushed as eb939109b9c06a09e1534a403745bd362b653d95.

Cheers,
- Brice




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-19 21:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-12 21:24 [bug#48986] [PATCH] gnu: opendoas: Fix restricted path "safepath" Brice Waegeneire
2021-06-16 20:53 ` Ludovic Courtès
2021-06-19 21:48   ` bug#48986: " Brice Waegeneire

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.