From cbac0b1db0d8a2e10438e319e9391f95355b2ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 25 May 2024 12:01:16 +0200 Subject: [PATCH] =?UTF-8?q?environment:=20Fix=20type=20error=20with=20?= =?UTF-8?q?=E2=80=98-C=E2=80=99=20when=20=E2=80=98getpwuid=E2=80=99=20fail?= =?UTF-8?q?s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes a bug with ‘guix shell -C …’ in cases where ‘getpwuid’ returns #f (for example because nscd isn’t running) and ‘user’ is #f. * guix/scripts/environment.scm (launch-environment/container): Use ‘name’ when building the ‘directory’ value, not ‘user’ since it can be #f. Change-Id: I5da807d982a1edbb4122ac29b5a1e5fc4b0ce1b7 --- guix/scripts/environment.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 1d7a6e198d..a219b2ac89 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2015, 2018 David Thompson -;;; Copyright © 2015-2023 Ludovic Courtès +;;; Copyright © 2015-2024 Ludovic Courtès ;;; Copyright © 2018 Mike Gerwitz ;;; Copyright © 2022, 2023 John Kehayias ;;; @@ -812,7 +812,7 @@ (define (nesting-mappings) (passwd:gecos pwd))) (uid uid) (gid gid) (shell bash) (directory (if (or user (not pwd)) - (string-append "/home/" user) + (string-append "/home/" name) (passwd:dir pwd)))))) (groups (list (group-entry (name "users") (gid gid)) (group-entry (gid 65534) ;the overflow GID