guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: environment: Set USER and LOGNAME in container


From: guix-commits
Subject: branch master updated: environment: Set USER and LOGNAME in container
Date: Sun, 30 Aug 2020 17:51:56 -0400

This is an automated email from the git hooks/post-receive script.

civodul pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new bc8be17  environment: Set USER and LOGNAME in container
bc8be17 is described below

commit bc8be17c4dd1e7bb8eb98a0b7e5bcb0a536719b0
Author: Lars-Dominik Braun <ldb@leibniz-psychology.org>
AuthorDate: Tue Aug 25 10:52:21 2020 +0200

    environment: Set USER and LOGNAME in container
    
    * guix/scripts/environment.scm (launch-environment/container): Set
      username environment variables.
    
    Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 guix/scripts/environment.scm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index b8979ca..1fb3505 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -477,6 +477,7 @@ WHILE-LIST."
                             (group-entry (gid 65534) ;the overflow GID
                                          (name "overflow"))))
             (home-dir (password-entry-directory passwd))
+            (logname  (password-entry-name passwd))
             (environ  (filter (match-lambda
                                 ((variable . value)
                                  (find (cut regexp-exec <> variable)
@@ -528,6 +529,10 @@ WHILE-LIST."
                       ;; The same variables as in Nix's 'build.cc'.
                       '("TMPDIR" "TEMPDIR" "TMP" "TEMP"))
 
+            ;; Some programs expect USER and/or LOGNAME to be set.
+            (setenv "LOGNAME" logname)
+            (setenv "USER" logname)
+
             ;; Create a dummy home directory.
             (mkdir-p home-dir)
             (setenv "HOME" home-dir)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]