From c20ba18304ee63f01895f092bb51bc2a9ce3303b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 10 Dec 2019 17:21:31 +0100 Subject: profiles: Use 'getpwuid' when $USER and $LOGNAME are undefined. Reported by YOANN P . * guix/profiles.scm (%profile-directory): Fall back to 'getpwuid' when "USER" and "LOGNAME" are undefined. --- guix/profiles.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guix') 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"))) -- cgit v1.2.3