mirror of
https://github.com/NixOS/nix.git
synced 2025-11-25 11:49:35 +01:00
On macOS, don't use /var/folders for TMPDIR
This broke "nix-store --serve".
(cherry picked from commit 25230a17a9)
This commit is contained in:
parent
c33854513a
commit
36f363b8f0
1 changed files with 8 additions and 0 deletions
|
|
@ -162,6 +162,14 @@ void initNix()
|
|||
|
||||
if (char *pack = getenv("_NIX_OPTIONS"))
|
||||
settings.unpack(pack);
|
||||
|
||||
/* On macOS, don't use the per-session TMPDIR (as set e.g. by
|
||||
sshd). This breaks build users because they don't have access
|
||||
to the TMPDIR, in particular in ‘nix-store --serve’. */
|
||||
#if __APPLE__
|
||||
if (getuid() == 0 && hasPrefix(getEnv("TMPDIR"), "/var/folders/"))
|
||||
unsetenv("TMPDIR");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue