guix_mirror_bot pushed a commit to branch add-tests-for-guix-shell-container
in repository guix.

commit c5b76579e86a0813e48aca79369c10a1243fb066
Author: Ludovic Courtès <[email protected]>
AuthorDate: Tue Dec 9 15:55:14 2025 +0900

    scripts/environment: Do not attempt to map GID 0.
    
    * guix/scripts/environment.scm (launch-environment/container): Do not 
attempt
    to map GID 0.
    
    Fixes: #4234
    Change-Id: If196430de5f09932e5dd736a55b75bbcda8cd7be
---
 guix/scripts/environment.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 1b3b1312ea..116e01380a 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -828,7 +828,11 @@ WHILE-LIST."
      (let* ((cwd      (getcwd))
             (home     (getenv "HOME"))
             (uid      (if user 1000 (getuid)))
-            (gid      (if user 1000 (getgid)))
+            (gid      (if user
+                          1000
+                          (match (getgid)
+                            (0 1000)
+                            (gid gid))))
 
             ;; On a foreign distro, the name service switch might be
             ;; dysfunctional and 'getpwuid' throws.  Don't let that hamper

Reply via email to