environment: Fix type error with ‘-C’ when ‘getpwuid’ fails.
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: I5da807d982a1edbb4122ac29b5a1e5fc4b0ce1b7master
parent
9756d9d634
commit
cbac0b1db0
|
@ -1,6 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014, 2015, 2018 David Thompson <davet@gnu.org>
|
;;; Copyright © 2014, 2015, 2018 David Thompson <davet@gnu.org>
|
||||||
;;; Copyright © 2015-2023 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2015-2024 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2018 Mike Gerwitz <mtg@gnu.org>
|
;;; Copyright © 2018 Mike Gerwitz <mtg@gnu.org>
|
||||||
;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
|
;;; Copyright © 2022, 2023 John Kehayias <john.kehayias@protonmail.com>
|
||||||
;;;
|
;;;
|
||||||
|
@ -812,7 +812,7 @@ WHILE-LIST."
|
||||||
(passwd:gecos pwd)))
|
(passwd:gecos pwd)))
|
||||||
(uid uid) (gid gid) (shell bash)
|
(uid uid) (gid gid) (shell bash)
|
||||||
(directory (if (or user (not pwd))
|
(directory (if (or user (not pwd))
|
||||||
(string-append "/home/" user)
|
(string-append "/home/" name)
|
||||||
(passwd:dir pwd))))))
|
(passwd:dir pwd))))))
|
||||||
(groups (list (group-entry (name "users") (gid gid))
|
(groups (list (group-entry (name "users") (gid gid))
|
||||||
(group-entry (gid 65534) ;the overflow GID
|
(group-entry (gid 65534) ;the overflow GID
|
||||||
|
|
Reference in New Issue