GNU bug report logs

#65832 [PATCH] guix: shell: Don't whitelist / by typo in `shell-authorized-directories'.

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #5 received at submit@debbugs.gnu.org (full text, mbox, reply):

Received: (at submit) by debbugs.gnu.org; 8 Sep 2023 20:49:36 +0000
From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 08 16:49:36 2023
Received: from localhost ([127.0.0.1]:45749 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1qeiQ3-0007oP-Hk
	for submit@debbugs.gnu.org; Fri, 08 Sep 2023 16:49:36 -0400
Received: from lists.gnu.org ([2001:470:142::17]:42208)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <janneke@gnu.org>) id 1qeiPy-0007o8-PO
 for submit@debbugs.gnu.org; Fri, 08 Sep 2023 16:49:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <janneke@gnu.org>) id 1qeiPq-0004jX-DA
 for bug-guix@gnu.org; Fri, 08 Sep 2023 16:49:22 -0400
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <janneke@gnu.org>)
 id 1qeiPp-0005v9-Hj; Fri, 08 Sep 2023 16:49:21 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to:
 references; bh=ynqbdq4vDN/V4O5wo06N4d9wfI9kwHKXvPI4BTHNyTo=; b=ShYb0a7sXfXzw5
 byEcEYxrpuwUggChjR0VZThIlyPtFGsixueL/kWIoPiRiJd6uoTr6vuYvyxUfsQcY6xQW0SIjECtz
 pM1RuZs63rQXuf5SWVuG754+3jR3VJvJm6hSvaDKzuvzK19rmlk3DKAPZYl/B4nXMxUWz7tQzuWko
 IwVPyA4adYXpsOVMpZyc7v2SVZeqmOoSXivB719n6LDRudYWDbhMaJgahmLPcGlMEMP/YQVcew8Yp
 XIsmFm3PyYaksp7UVHUMfLGp1F6QjX5aV82Cm+OP/pasAx3MA/vSyotYgh+mSDynlZK5EG4o1awMK
 o4t+mYbBG6q7Pm9r5uVg==;
From: Janneke Nieuwenhuizen <janneke@gnu.org>
To: bug-guix@gnu.org
Subject: [PATCH] guix: shell: Don't whitelist / by typo in
 `shell-authorized-directories'.
Organization: AvatarAcademy.nl
X-Url: http://AvatarAcademy.nl
Date: Fri, 08 Sep 2023 22:49:11 +0200
Message-ID: <87tts4qtko.fsf@gnu.org>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.0 (-)
[Message part 1 (text/plain, inline)]
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

[0001-guix-shell-Don-t-whitelist-by-typo-in-shell-authoriz.patch (text/x-patch, inline)]
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

[Message part 3 (text/plain, inline)]
-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 11:13:28 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.