diff options
author | Ludovic Courtès <ludo@gnu.org> | 2019-12-10 17:21:31 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2019-12-10 20:56:06 +0100 |
commit | c20ba18304ee63f01895f092bb51bc2a9ce3303b (patch) | |
tree | c95cc874f8baf010637918fab3c19005474bd1d4 | |
parent | dc995fcd5a62496721757f4ecb7f9b9d65399b5c (diff) | |
download | patches-c20ba18304ee63f01895f092bb51bc2a9ce3303b.tar patches-c20ba18304ee63f01895f092bb51bc2a9ce3303b.tar.gz |
profiles: Use 'getpwuid' when $USER and $LOGNAME are undefined.
Reported by YOANN P <yoann_mac_donald@hotmail.com>.
* guix/profiles.scm (%profile-directory): Fall back to 'getpwuid' when
"USER" and "LOGNAME" are undefined.
-rw-r--r-- | guix/profiles.scm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm index f5e5cc33d6..616605151e 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1727,7 +1727,9 @@ because the NUMBER is zero.)" (define %profile-directory (string-append %state-directory "/profiles/" (or (and=> (or (getenv "USER") - (getenv "LOGNAME")) + (getenv "LOGNAME") + (false-if-exception + (passwd:name (getpwuid (getuid))))) (cut string-append "per-user/" <>)) "default"))) |