unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65832: [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories'.
@ 2023-09-08 20:49 Janneke Nieuwenhuizen
  2023-09-08 20:54 ` Janneke Nieuwenhuizen
  2023-09-11 15:49 ` Ludovic Courtès
  0 siblings, 2 replies; 3+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-09-08 20:49 UTC (permalink / raw)
  To: 65832

[-- Attachment #1: Type: text/plain, Size: 635 bytes --]

Title says it all...

So, i've started using direnv with envrc.el, really great!

...which meant that on top op `guix shell' pestering me with its
shell-authorized-directories, I had to also type `direnv allow' all day.

Anyway, I found that direnv has a whitelist, prefix even; so I looked
into what guix shell might have and found that using

--8<---------------cut here---------------start------------->8---
echo '-allow-all- > ~/.config/guix/shell-authorized-directories
--8<---------------cut here---------------end--------------->8---

acts like an undocumented whitelist prefix for /.

Find a fix attached.

Greetings,
Janneke


[-- Attachment #2: 0001-guix-shell-Don-t-whitelist-by-typo-in-shell-authoriz.patch --]
[-- Type: text/x-patch, Size: 1555 bytes --]

From 5b7af1342f4f0d91df9de960877889d40b8c5d64 Mon Sep 17 00:00:00 2001
Message-ID: <5b7af1342f4f0d91df9de960877889d40b8c5d64.1694206063.git.janneke@gnu.org>
From: Janneke Nieuwenhuizen <janneke@gnu.org>
Date: Wed, 6 Sep 2023 10:52:17 +0200
Subject: [PATCH] guix: shell: Don't whitelist / by typo in
 `shell-authorized-directories'.

Fixes <https://issues.guix.gnu.org/...>

* guix/scripts/shell.scm (authorized-shell-directory?): After warning,
continue LOOP to return valid query result for DIRECTORY.
---
 guix/scripts/shell.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/shell.scm b/guix/scripts/shell.scm
index d67152cef7..83888eee1d 100644
--- a/guix/scripts/shell.scm
+++ b/guix/scripts/shell.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2021-2023 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2023 Janneke Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -232,7 +233,8 @@ (define (authorized-shell-directory? directory)
                                            (port-line port)
                                            (port-column port))))
                         (warning loc (G_ "ignoring invalid file name: '~a'~%")
-                                 line))))))))))
+                                 line)
+                        (loop))))))))))
     (const #f)))
 
 (define (options-with-caching opts)

base-commit: 4dd33fc62899134606f36f92594cf160b972f685
-- 
2.41.0


[-- Attachment #3: Type: text/plain, Size: 164 bytes --]


-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

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

* bug#65832: [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories'.
  2023-09-08 20:49 bug#65832: [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories' Janneke Nieuwenhuizen
@ 2023-09-08 20:54 ` Janneke Nieuwenhuizen
  2023-09-11 15:49 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-09-08 20:54 UTC (permalink / raw)
  To: 65832-done

Janneke Nieuwenhuizen writes:

Hi!

> Title says it all...

[..]

After discussing with the security team, pushed to master as

    1ef4974be94d75d935d98399dcda44199a1fca47

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com




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

* bug#65832: [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories'.
  2023-09-08 20:49 bug#65832: [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories' Janneke Nieuwenhuizen
  2023-09-08 20:54 ` Janneke Nieuwenhuizen
@ 2023-09-11 15:49 ` Ludovic Courtès
  1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2023-09-11 15:49 UTC (permalink / raw)
  To: Janneke Nieuwenhuizen; +Cc: 65832

Hi,

Janneke Nieuwenhuizen <janneke@gnu.org> skribis:

> From: Janneke Nieuwenhuizen <janneke@gnu.org>
> Date: Wed, 6 Sep 2023 10:52:17 +0200
> Subject: [PATCH] guix: shell: Don't whitelist / by typo in
>  `shell-authorized-directories'.
>
> Fixes <https://issues.guix.gnu.org/...>
>
> * guix/scripts/shell.scm (authorized-shell-directory?): After warning,
> continue LOOP to return valid query result for DIRECTORY.

Thanks a lot for finding, reporting, and fixing this issue!

Ludo’.




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

end of thread, other threads:[~2023-09-11 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 20:49 bug#65832: [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories' Janneke Nieuwenhuizen
2023-09-08 20:54 ` Janneke Nieuwenhuizen
2023-09-11 15:49 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).