scripts/environment: Do not attempt to map GID 0.
Changes
1 files changed · +5 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| guix/scripts/environment.scm | modified | +5 | −1 | View file |
guix/scripts/environment.scm
View filediff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 1b3b131..116e013 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