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.
This commit is contained in:
parent
dc995fcd5a
commit
c20ba18304
1 changed files with 3 additions and 1 deletions
|
@ -1727,7 +1727,9 @@ because the NUMBER is zero.)"
|
||||||
(define %profile-directory
|
(define %profile-directory
|
||||||
(string-append %state-directory "/profiles/"
|
(string-append %state-directory "/profiles/"
|
||||||
(or (and=> (or (getenv "USER")
|
(or (and=> (or (getenv "USER")
|
||||||
(getenv "LOGNAME"))
|
(getenv "LOGNAME")
|
||||||
|
(false-if-exception
|
||||||
|
(passwd:name (getpwuid (getuid)))))
|
||||||
(cut string-append "per-user/" <>))
|
(cut string-append "per-user/" <>))
|
||||||
"default")))
|
"default")))
|
||||||
|
|
||||||
|
|
Reference in a new issue