Skip to content
Snippets Groups Projects
Unverified Commit 25230a17 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

On macOS, don't use /var/folders for TMPDIR

This broke "nix-store --serve".
parent 847f19a5
No related branches found
No related tags found
No related merge requests found
......@@ -138,6 +138,14 @@ void initNix()
struct timeval tv;
gettimeofday(&tv, 0);
srandom(tv.tv_usec);
/* 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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment